/* ===========================
   CSS Reset & Base Styles
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  color: #333;
  background: #f5f5f5;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #e63946;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===========================
   Top Bar
   =========================== */
.top-bar {
  background: #e63946;
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 0;
  border-bottom: 2px solid #c1121f;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-nav {
  display: flex;
  gap: 20px;
}

.top-nav a {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}

.top-nav a:hover {
  color: #fff;
  opacity: 0.8;
}

.top-date {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
}

/* ===========================
   Main Header
   =========================== */
.main-header {
  background: #fff;
  border-bottom: 3px solid #e63946;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.main-header .container {
  padding-top: 24px;
  padding-bottom: 20px;
  text-align: center;
}

.site-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-title {
  font-size: 2rem;
  font-weight: 900;
  color: #1a1a2e;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: block;
}

.site-title:hover {
  color: #e63946;
}

.site-desc {
  font-size: 0.82rem;
  color: #666;
  max-width: 600px;
  text-align: center;
}

/* ===========================
   Category Nav
   =========================== */
.category-nav {
  border-top: 1px solid #eee;
  background: #fff;
}

.category-nav .container {
  display: flex;
  gap: 0;
  padding-top: 0;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.category-nav a {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.category-nav a:hover,
.category-nav a.active {
  color: #e63946;
  border-bottom-color: #e63946;
}

/* ===========================
   Site Main
   =========================== */
.site-main {
  padding: 28px 0 48px;
}

/* ===========================
   Content Wrapper (メイン70% + サイドバー30%)
   =========================== */
.content-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-content {
  flex: 0 0 calc(70% - 12px);
  min-width: 0;
}

.sidebar {
  flex: 0 0 calc(30% - 12px);
  min-width: 0;
}

/* ===========================
   Featured Article
   =========================== */
.featured-article {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s;
}

.featured-article:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.pickup-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #e63946;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 10;
}

.featured-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.featured-icon {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.featured-body {
  padding: 20px 22px 22px;
}

.featured-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.4;
  margin: 8px 0 10px;
  color: #1a1a2e;
}

.featured-title a:hover {
  color: #e63946;
}

.featured-desc {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #888;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.read-more {
  background: #e63946;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  transition: background 0.2s;
}

.read-more:hover {
  background: #c1121f;
  color: #fff !important;
}

/* ===========================
   Article Grid (2x2)
   =========================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-grid.full {
  grid-template-columns: repeat(2, 1fr);
}

/* ===========================
   Article Card
   =========================== */
.article-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.card-image {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.card-icon {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}

.card-body {
  padding: 12px 14px 14px;
}

.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 6px 0 8px;
  color: #1a1a2e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a:hover {
  color: #e63946;
}

.card-desc {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 0.75rem;
  color: #999;
}

/* ===========================
   Category Tags
   =========================== */
.cat-tag {
  display: inline-block;
  background: #e63946;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.cat-tag.small {
  font-size: 0.68rem;
  padding: 2px 8px;
}

.cat-tag.tiny {
  font-size: 0.62rem;
  padding: 1px 6px;
}

/* カテゴリ別カラー（記事タグの色分け） */
.cat-tag:nth-child(1) { background: #2563eb; }
.cat-tag:nth-child(2) { background: #7c3aed; }
.cat-tag:nth-child(3) { background: #059669; }
.cat-tag:nth-child(4) { background: #d97706; }
.cat-tag:nth-child(5) { background: #e63946; }

/* ===========================
   Sidebar & Widgets
   =========================== */
.sidebar .widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.widget-title {
  background: #1a1a2e;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 16px;
  letter-spacing: 0.03em;
  border-bottom: 3px solid #e63946;
}

.widget p {
  padding: 14px 16px;
  font-size: 0.84rem;
  color: #555;
  line-height: 1.7;
}

.widget.notice {
  border-color: #fde8d8;
}

.widget.notice .widget-title {
  background: #e63946;
}

/* ===========================
   Category List (Sidebar)
   =========================== */
.cat-list {
  padding: 8px 0;
}

.cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.86rem;
}

.cat-list li:last-child {
  border-bottom: none;
}

.cat-list li a {
  color: #333;
  transition: color 0.2s;
}

.cat-list li a:hover {
  color: #e63946;
}

.cat-count {
  background: #e63946;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}

/* ===========================
   Popular List (Sidebar)
   =========================== */
.popular-list {
  list-style: none;
  padding: 8px 0;
  counter-reset: popular-counter;
}

.popular-list li {
  counter-increment: popular-counter;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f5f5f5;
  position: relative;
}

.popular-list li:last-child {
  border-bottom: none;
}

.popular-list li::before {
  content: counter(popular-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: #e63946;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  border-radius: 4px;
}

.popular-list li:nth-child(1)::before { background: #e63946; }
.popular-list li:nth-child(2)::before { background: #e6773d; }
.popular-list li:nth-child(3)::before { background: #d97706; }
.popular-list li:nth-child(4)::before { background: #6b7280; }
.popular-list li:nth-child(5)::before { background: #6b7280; }

.popular-item {
  font-size: 0.82rem;
  line-height: 1.5;
}

.popular-item a {
  color: #333;
  transition: color 0.2s;
}

.popular-item a:hover {
  color: #e63946;
}

/* ===========================
   Page Title (List Pages)
   =========================== */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1a2e;
  padding: 0 0 16px;
  margin-bottom: 20px;
  border-bottom: 3px solid #e63946;
}

/* ===========================
   Single Article
   =========================== */
.single-article {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 32px 36px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}

.article-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.article-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.4;
  color: #1a1a2e;
  margin: 12px 0 14px;
}

.article-meta {
  display: flex;
  gap: 20px;
  font-size: 0.83rem;
  color: #888;
}

/* 記事本文スタイル */
.article-body {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #333;
}

.article-body h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1a2e;
  margin: 2em 0 0.8em;
  padding: 10px 16px;
  border-left: 4px solid #e63946;
  background: #fef8f8;
  border-radius: 0 6px 6px 0;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 1.6em 0 0.6em;
  padding-bottom: 6px;
  border-bottom: 2px solid #e0e0e0;
}

.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
  margin: 1.4em 0 0.5em;
}

.article-body p {
  margin-bottom: 1.2em;
}

.article-body ul,
.article-body ol {
  margin: 1em 0 1.2em 1.5em;
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: 0.5em;
  padding-left: 4px;
}

.article-body strong,
.article-body b {
  font-weight: 700;
  color: #1a1a2e;
}

.article-body em {
  font-style: italic;
}

.article-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: #e63946;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  background: #f8f9fa;
  border-left: 4px solid #e63946;
  color: #555;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.article-body th {
  background: #1a1a2e;
  color: #fff;
  font-weight: 700;
}

.article-body tr:nth-child(even) td {
  background: #f9f9f9;
}

.article-body code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  color: #e63946;
}

.article-body pre {
  background: #1a1a2e;
  color: #e8e8e8;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 48px 0 0;
  margin-top: 48px;
  border-top: 4px solid #e63946;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e63946;
  display: inline-block;
}

.footer-col p {
  font-size: 0.84rem;
  line-height: 1.8;
  color: #aaa;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: #aaa;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: #e63946;
}

.footer-bottom {
  text-align: center;
  padding: 20px 0;
  font-size: 0.8rem;
  color: #666;
}

/* ===========================
   Responsive (768px以下)
   =========================== */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }

  .main-content,
  .sidebar {
    flex: none;
    width: 100%;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-grid.full {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-title {
    font-size: 1.4rem;
  }

  .featured-title {
    font-size: 1.1rem;
  }

  .category-nav .container {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .category-nav a {
    white-space: nowrap;
    padding: 10px 14px;
  }

  .single-article {
    padding: 20px 16px;
  }

  .top-bar .container {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .top-nav {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .featured-image {
    height: 150px;
    font-size: 2.5rem;
  }

  .card-image {
    height: 80px;
    font-size: 1.6rem;
  }

  .article-header h1 {
    font-size: 1.3rem;
  }
}
