/* ================================================
   カズの日記 — カスタムスタイル
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&family=Noto+Serif+JP:wght@400;700&display=swap');

/* --- CSS変数フォールバック（テーマ未読み込み時用） --- */

/* --- 基本 --- */
body {
  font-family: "Noto Serif JP", serif;
  font-size: 18px;
}

h1, h2, h3, h4, h5, h6,
.site-nav, .site-title-link, .site-menu,
.post-title-bar, .breadcrumb-bar, .post-meta-line,
.home-post-title, .home-post-meta,
.pager a {
  font-family: "Noto Sans JP", sans-serif;
}

/* --- テーマ元のナビバー・ヘッダーを非表示 --- */
.navbar-custom, .navbar, .intro-header {
  display: none !important;
}

/* ================================================
   バナー画像
   ================================================ */
.site-banner {
  background: #1f2c39;
  height: 280px;
  overflow: hidden;
  line-height: 0;
}

.site-banner img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 90%;
  display: block;
}

/* ================================================
   ナビバー
   ================================================ */
.site-nav {
  background: #2c3e50;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.site-title-link {
  font-size: 28px;
  font-weight: 900;
  color: #fff !important;
  text-decoration: none !important;
}

.site-title-link:hover {
  color: #ddd !important;
}

.site-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.site-menu li a {
  color: #ccc;
  text-decoration: none;
  font-size: 16px;
  padding: 10px 20px;
  transition: color 0.2s;
}

.site-menu li a:hover {
  color: #fff;
}

/* ================================================
   パンくずリスト
   ================================================ */
.breadcrumb-bar {
  background: var(--color-bg, #fff);
  padding: 16px 0;
  font-size: 15px;
  color: var(--color-text-muted, gray);
}

.breadcrumb-bar a {
  color: var(--color-primary, #0085a1);
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.breadcrumb-bar span {
  color: var(--color-text-secondary, #a3a3a3);
}

/* ================================================
   記事タイトル帯
   ================================================ */
.post-title-bar {
  background: #2c3e50;
  padding: 18px 0;
}

.post-title-bar h1 {
  color: #fff !important;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

/* ================================================
   記事メタ情報
   ================================================ */
.post-meta-line {
  padding: 14px 0;
  font-size: 16px;
  color: var(--color-text-muted, gray);
  border-bottom: 1px solid var(--color-border, #eee);
  margin-bottom: 28px;
}

.post-meta-line a {
  color: var(--color-primary, #0085a1);
  text-decoration: none;
}

.post-meta-line a:hover {
  text-decoration: underline;
}

/* ================================================
   アイキャッチ画像
   ================================================ */
.post-featured-image {
  margin-bottom: 28px;
}

.post-featured-image img {
  width: 100%;
  height: auto;
}

/* ================================================
   記事本文
   ================================================ */
.post-body {
  font-size: 18px;
  line-height: 2;
  color: var(--color-text-main, #404040);
}

.post-body p {
  font-size: 18px;
  line-height: 2;
  margin-bottom: 1.2em;
}

.post-body li {
  font-size: 18px;
  line-height: 2;
}

.post-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2c3e50;
}

.post-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.post-body h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
}

.post-body img {
  max-width: 100%;
  height: auto;
}

/* ================================================
   トップページ — お知らせメッセージ
   ================================================ */
.farewell-message {
  margin: 24px 0;
  padding: 18px 24px;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 6px;
  text-align: center;
  color: #fff;
}

.farewell-message .farewell-text {
  font-size: 16px !important;
  line-height: 1.8 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  margin: 0 0 10px !important;
}

.farewell-message .farewell-note {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  margin: 0 !important;
}

/* ================================================
   トップページ — 記事一覧
   ================================================ */
.home-post-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border, #eee);
  align-items: flex-start;
}

.home-post-content {
  flex: 1;
  min-width: 0;
}

.home-post-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.4;
}

.home-post-title a {
  color: var(--color-text-main, #404040);
  text-decoration: none;
}

.home-post-title a:hover {
  color: var(--color-primary, #0085a1);
}

.home-post-meta {
  font-size: 15px;
  color: var(--color-text-muted, gray);
  margin-bottom: 10px;
}

.home-post-meta a {
  color: var(--color-primary, #0085a1);
  text-decoration: none;
}

.home-post-meta a:hover {
  text-decoration: underline;
}

.home-post-summary {
  font-size: 16px;
  color: var(--color-text-secondary, #a3a3a3);
  line-height: 1.7;
  margin: 0;
}

.home-post-thumb {
  flex-shrink: 0;
  width: 180px;
}

.home-post-thumb img {
  width: 180px;
  height: 130px;
  object-fit: cover;
  border-radius: 4px;
}

/* ================================================
   サイドバー補正
   ================================================ */
.sidebar-container hr {
  display: none;
}

.sidebar-container h5 {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-main, #404040);
  margin-top: 28px;
  margin-bottom: 14px;
}

.sidebar-container section:first-child h5 {
  margin-top: 28px;
}

/* ================================================
   ページネーション
   ================================================ */
.pager {
  margin-top: 32px;
}

.pager a {
  font-size: 16px;
}

/* ================================================
   著者ページ
   ================================================ */
.author-header {
  background: #2c3e50;
  padding: 18px 0;
}

.author-header h1 {
  color: #fff !important;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
}

.author-count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

/* ================================================
   サイドバー — 著者
   ================================================ */
.sidebar-authors {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-authors li {
  padding: 6px 0;
}

.sidebar-authors a {
  color: var(--color-primary, #0085a1);
  text-decoration: none;
  font-size: 15px;
}

.sidebar-authors a:hover {
  text-decoration: underline;
}

.author-post-count {
  font-size: 13px;
  color: var(--color-text-muted, gray);
}

/* ================================================
   サイドバー — アーカイブ
   ================================================ */
.archive-nav {
  max-height: 500px;
  overflow-y: auto;
  font-size: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #ccc) transparent;
}

.archive-nav::-webkit-scrollbar {
  width: 4px;
}

.archive-nav::-webkit-scrollbar-track {
  background: transparent;
}

.archive-nav::-webkit-scrollbar-thumb {
  background: var(--color-border, #ccc);
  border-radius: 4px;
}

.archive-year {
  margin-bottom: 2px;
}

.archive-year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
}

.archive-year-header:hover {
  background: var(--bg-tag-cloud, #eee);
}

.archive-year-label {
  font-weight: 700;
  font-size: 14px;
}

.archive-year-label::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  font-size: 11px;
  color: var(--color-text-muted, gray);
  transition: transform 0.15s;
}

.archive-year.is-open .archive-year-label::before {
  content: "▾";
}

.archive-year-count {
  font-size: 12px;
  color: var(--color-text-muted, gray);
}

.archive-months {
  display: none;
  padding: 2px 0 6px 22px;
  line-height: 1;
}

.archive-year.is-open .archive-months {
  display: block;
}

.archive-month-link {
  font-size: 13px;
  color: var(--color-primary, #0085a1);
  text-decoration: none;
  white-space: nowrap;
}

.archive-month-link::after {
  content: " · ";
  color: var(--color-text-muted, gray);
}

.archive-month-link:last-child::after {
  content: "";
}

.archive-month-link:hover {
  text-decoration: underline;
}

.archive-month-count {
  font-size: 12px;
  color: var(--color-text-muted, gray);
}

/* ================================================
   アーカイブページ
   ================================================ */
.archive-page-title {
  font-size: 24px;
  font-weight: 900;
  margin: 24px 0 20px;
  font-family: "Noto Sans JP", sans-serif;
}

.archive-year-heading {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #2c3e50;
  font-family: "Noto Sans JP", sans-serif;
}

.archive-year-total,
.archive-month-total {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted, gray);
}

.archive-month-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 16px 0 6px;
  font-family: "Noto Sans JP", sans-serif;
}

.archive-posts {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.archive-posts li {
  padding: 4px 0;
  font-size: 15px;
}

.archive-date {
  display: inline-block;
  width: 42px;
  color: var(--color-text-muted, gray);
  font-size: 14px;
}

.archive-posts a {
  color: var(--color-primary, #0085a1);
  text-decoration: none;
}

.archive-posts a:hover {
  text-decoration: underline;
}

/* ================================================
   検索モーダル
   ================================================ */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
}

.search-modal-content {
  background: var(--color-bg, #fff);
  width: 90%;
  max-width: 640px;
  border-radius: 8px;
  padding: 48px 24px 24px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.search-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted, #999);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  padding: 2px 6px;
}

.search-close:hover {
  color: var(--color-text-main, #333);
}

#search-toggle {
  cursor: pointer;
}

/* ================================================
   レスポンシブ
   ================================================ */
@media (max-width: 991px) {
  .site-nav-inner {
    height: auto;
    padding: 12px 0;
    flex-direction: column;
    gap: 8px;
  }

  .site-title-link {
    font-size: 22px;
  }

  .site-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .home-post-item {
    flex-direction: column;
    gap: 12px;
  }

  .home-post-thumb {
    width: 100%;
  }

  .home-post-thumb img {
    width: 100%;
    height: auto;
    max-height: 200px;
  }
}

@media (max-width: 768px) {
  .site-banner {
    height: 160px;
  }

  .site-banner img {
    height: 160px;
  }

  .post-title-bar h1 {
    font-size: 20px;
  }
}
