/* ============================================
   Note Template — style.css
   ============================================ */

:root {
  --accent:       #3ea8ff;
  --accent-dark:  #0f83fd;
  --text-primary: #171717;
  --text-body:    #333;
  --text-sub:     #868686;
  --text-muted:   #b0b0b0;
  --bg:           #fff;
  --bg-sub:       #f5f5f5;
  --border:       #e8e8e8;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --font-serif: 'Georgia', 'Hiragino Mincho ProN', 'Yu Mincho',
                'Noto Serif JP', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

/* ========================================
   Header
   ======================================== */
.n-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.n-header__inner {
  max-width: min(90vw, 1800px);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.n-header__logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -.04em;
  flex-shrink: 0;
}
.n-header__logo:hover { color: var(--accent); }

/* ========================================
   コンテナ
   ======================================== */
.n-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.n-container--wide {
  max-width: min(90vw, 1800px);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ========================================
   タグ
   ======================================== */
.n-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.n-tag {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  background: #e8f4ff;
  padding: .2em .65em;
  border-radius: 100px;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* ========================================
   トップページ
   ======================================== */
.n-top { padding: 2rem 0 4rem; }

.n-section { margin-bottom: 3rem; }

.n-section__head {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.n-section__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.n-section__tag-prefix {
  color: var(--accent);
  margin-right: .1em;
}
.n-section__count {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 400;
}
.n-section__more { margin-top: .75rem; text-align: right; }
.n-section__more-note { font-size: .78rem; color: var(--text-muted); }
a.n-section__more-note { text-decoration: none; }
a.n-section__more-note:hover { text-decoration: underline; }
.n-tag--link { cursor: pointer; }
.n-tag--link:hover { background: #d6ecff; }
.n-section__tag-link { display: inline-flex; align-items: baseline; text-decoration: none; color: inherit; }
.n-section__tag-link:hover .n-section__title { text-decoration: underline; }

/* ========================================
   グリッド
   ======================================== */
.n-grid {
  display: grid;
  gap: 1rem;
}
.n-grid--6col {
  grid-template-columns: repeat(6, 1fr);
}

/* ========================================
   カード
   ======================================== */
.n-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.n-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.n-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}
.n-card__thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-sub);
  flex-shrink: 0;
}
.n-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.n-card:hover .n-card__thumb img { transform: scale(1.04); }
.n-card__thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--border);
  background: linear-gradient(135deg, #f8f8f8, #efefef);
}
.n-card__body {
  padding: .75rem .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}
.n-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.n-card__title {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary);
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.n-card__desc {
  font-size: .72rem;
  color: var(--text-sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex: 1;
}
.n-meta-date {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: .35rem;
  display: block;
}

/* ========================================
   空の状態
   ======================================== */
.n-empty {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.n-empty__icon { font-size: 2.5rem; margin-bottom: .75rem; }
.n-empty__text { font-size: .9rem; }

/* ========================================
   記事ページ — ヘッダー
   ======================================== */
.n-article-header { padding: 2.5rem 0 1.75rem; }
.n-article-title {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -.03em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.n-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.n-article-meta__date {
  font-size: .82rem;
  color: var(--text-sub);
}

/* ========================================
   記事ページ — サムネイル
   ======================================== */
.n-article-eyecatch { margin: 0 0 2.5rem; }
.n-article-eyecatch img {
  width: 100%;
  border-radius: 4px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ========================================
   記事ページ — 本文
   ======================================== */
.n-article-body { padding: 0 0 4rem; }
.n-article-content {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 2.0;
  color: var(--text-body);
}
.n-article-content p { margin-bottom: 0rem; }
.n-article-content h1,
.n-article-content h2,
.n-article-content h3,
.n-article-content h4,
.n-article-content h5,
.n-article-content h6 {
  font-family: var(--font-sans);
  font-weight: 800;
  line-height: 1.45;
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin: 2.75rem 0 1rem;
}
.n-article-content h1 { font-size: 1.6rem; }
.n-article-content h2 {
  font-size: 1.35rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
}
.n-article-content h3 { font-size: 1.15rem; }
.n-article-content h4 { font-size: 1rem; }
.n-article-content ul,
.n-article-content ol { margin: 1rem 0 1.6rem 1.5rem; }
.n-article-content li { margin-bottom: .5rem; }
.n-article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .75rem 1.25rem;
  margin: 2rem 0;
  color: var(--text-sub);
  font-style: italic;
  background: #f8fbff;
  border-radius: 0 6px 6px 0;
}
.n-article-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.65;
  margin: 2rem 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
.n-article-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: .84em;
  background: #f0f0f5;
  color: #c026d3;
  padding: .15em .4em;
  border-radius: 4px;
}
.n-article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.n-article-content a {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: border-color .15s;
}
.n-article-content a:hover { border-color: var(--text-primary); }
.n-article-content img {
  border-radius: 6px;
  margin: 2.5rem auto;
}
.n-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: .92rem;
  font-family: var(--font-sans);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.n-article-content th,
.n-article-content td {
  padding: .65rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.n-article-content th {
  background: var(--bg-sub);
  font-weight: 700;
}
.n-article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ========================================
   記事ページ — 関連記事
   ======================================== */
.n-article-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 4rem;
}
.n-related__title {
  font-size: .8rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1.25rem;
}
.n-related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.n-related-item { background: var(--bg); }
.n-related-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  transition: background .15s;
}
.n-related-item a:hover { background: var(--bg-sub); }
.n-related-thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-sub);
}
.n-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.n-related-thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--border);
}
.n-related-info { flex: 1; min-width: 0; }
.n-related-info__title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: .25rem;
}
.n-related-info__date {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ========================================
   Footer
   ======================================== */
.n-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.n-footer__inner {
  max-width: min(90vw, 1800px);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.n-footer__logo {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -.03em;
}
.n-footer__copy {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1100px) {
  .n-grid--6col { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .n-grid--6col { grid-template-columns: repeat(3, 1fr); }
  .n-top { padding: 1.5rem 0 3rem; }
  .n-article-title { font-size: 1.5rem; }
  .n-article-content { font-size: 1rem; line-height: 1.85; }
  .n-article-content h1 { font-size: 1.4rem; }
  .n-article-content h2 { font-size: 1.2rem; }
  .n-article-content h3 { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .n-grid--6col { grid-template-columns: repeat(2, 1fr); }
  .n-grid { gap: .75rem; }
  .n-top { padding: 1.25rem 0 2.5rem; }
  .n-section { margin-bottom: 2rem; }
  .n-section__title { font-size: .9rem; }
  .n-card__body { padding: .6rem .7rem .75rem; }
  .n-card__title { font-size: .78rem; -webkit-line-clamp: 2; }
  .n-card__desc { display: none; }
  .n-card__tags { display: none; }
  .n-meta-date { font-size: .65rem; }
  .n-article-header { padding: 1.5rem 0 1.25rem; }
  .n-article-title { font-size: 1.3rem; letter-spacing: -.02em; }
  .n-article-content { font-size: .95rem; line-height: 1.8; }
  .n-article-content h1 { font-size: 1.25rem; }
  .n-article-content h2 { font-size: 1.1rem; }
  .n-article-content h3 { font-size: 1rem; }
  .n-article-content pre { font-size: .78rem; padding: 1rem; border-radius: 6px; }
  .n-author-box { flex-direction: column; align-items: flex-start; gap: .75rem; padding: 1.25rem; }
  .n-related-thumb { width: 52px; height: 52px; }
  .n-footer__inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

@media (max-width: 360px) {
  .n-grid--6col { grid-template-columns: repeat(2, 1fr); }
  .n-grid { gap: .5rem; }
  .n-card__title { font-size: .74rem; }
  .n-article-title { font-size: 1.15rem; }
}

/* ========================================
   404ページ
   ======================================== */
.n-not-found {
  padding: 5rem 1.25rem;
  text-align: center;
}
.n-not-found__code {
  font-size: 4rem;
  font-weight: 900;
  color: var(--bg-sub);
  line-height: 1;
  margin-bottom: 1rem;
}
.n-not-found__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .75rem;
}
.n-not-found__desc {
  color: var(--text-sub);
  margin-bottom: 2rem;
}
.n-not-found__home {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.6rem;
  border-radius: 100px;
  font-size: .9rem;
  font-weight: 600;
}
.n-not-found__home:hover { background: var(--accent-dark); }
