/*
Theme Name: Skillminder Theme
Theme URI: https://skillminder-hub.com
Author: Skillminder
Author URI: https://skillminder-hub.com
Description: Skillminder Hub オリジナルブログテーマ
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: skillminder-theme
*/

/* ========================================
   リセット・基本スタイル
======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  background-color: #f0faf4;
}

a {
  color: #2d6a4f;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ========================================
   レイアウト
======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-body {
  display: flex;
  gap: 40px;
  padding: 60px 0;
}

.site-body .content-area {
  flex: 1;
  min-width: 0;
}

/* ========================================
   ヘッダー
======================================== */
.site-header {
  background: linear-gradient(135deg, #1b4332 0%, #163d2e 100%);
  color: #fff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid #52b788;
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

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

.site-title a {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.site-title a:hover {
  opacity: 0.85;
  text-decoration: none;
}

.site-title-icon {
  font-size: 1.15em;
  line-height: 1;
}

.site-description {
  color: #8899aa;
  font-size: 0.8rem;
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* ========================================
   ナビゲーション
======================================== */
.global-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

.global-nav a {
  color: #fff;
  font-size: 0.95rem;
}

.global-nav a:hover {
  color: #52b788;
  text-decoration: none;
}

/* ========================================
   投稿カード（一覧）
======================================== */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  gap: 20px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-card-thumbnail {
  width: 160px;
  flex-shrink: 0;
}

.post-card-thumbnail img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
}

.post-card-body {
  flex: 1;
}

.post-card-title {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

.post-card-title a {
  color: #1b4332;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: #666;
}

.post-card-meta {
  font-size: 0.8rem;
  color: #999;
  margin-top: 10px;
}

/* ========================================
   シングル記事
======================================== */
.post-content {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.post-title {
  font-size: 1.8rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.post-meta {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.post-thumbnail-wrap {
  margin-bottom: 32px;
}

.post-thumbnail-wrap img {
  width: 100%;
  border-radius: 6px;
}

.entry-content h2 {
  font-size: 1.4rem;
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 4px solid #1b4332;
}

.entry-content h3 {
  font-size: 1.15rem;
  margin: 24px 0 10px;
}

.entry-content p {
  margin-bottom: 16px;
}

/* ========================================
   サイドバー
======================================== */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 80px; /* sticky ヘッダーの高さ + 余白 */
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.widget-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1b4332;
}

.widget ul {
  list-style: none;
}

.widget ul li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

/* ========================================
   ページネーション
======================================== */
.pagination {
  margin-top: 40px;
  text-align: center;
}

.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}

.pagination .current {
  background: #1b4332;
  color: #fff;
  border-color: #1b4332;
}

/* ========================================
   フッター
======================================== */
.site-footer {
  background: linear-gradient(180deg, #163d2e 0%, #1b4332 100%);
  color: #aaa;
  font-size: 0.88rem;
  border-top: 3px solid #52b788;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 48px 0 36px;
}

/* ブランドカラム */
.footer-logo a {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}

.footer-logo a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.footer-desc {
  color: #7788aa;
  font-size: 0.85rem;
  line-height: 1.75;
}

/* フッターカラム共通 */
.footer-col-title {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.04em;
}

.footer-col-nav ul,
.footer-col-categories ul {
  list-style: none;
}

.footer-col-nav ul li,
.footer-col-categories ul li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.footer-col-nav ul li a,
.footer-col-categories ul li a {
  color: #99aabb;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
  display: inline-block;
}

.footer-col-nav ul li a:hover,
.footer-col-categories ul li a:hover {
  color: #52b788;
  padding-left: 4px;
  text-decoration: none;
}

/* フッター下部 */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 18px 0;
  text-align: center;
  color: #556677;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

/* ========================================
   記事本文スタイル
======================================== */
.entry-content ul,
.entry-content ol {
  margin: 0 0 16px 1.5em;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  margin-bottom: 6px;
}

.entry-content code {
  background: #edf7f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #1b4332;
}

.entry-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.6;
}

.entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

.entry-content blockquote {
  border-left: 4px solid #52b788;
  padding: 12px 20px;
  margin: 0 0 20px;
  background: #edf7f0;
  color: #2d4a3a;
  border-radius: 0 4px 4px 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.entry-content table th,
.entry-content table td {
  padding: 10px 14px;
  border: 1px solid #ddd;
  text-align: left;
}

.entry-content table th {
  background: #1b4332;
  color: #fff;
}

.entry-content table tr:nth-child(even) td {
  background: #f8f8f8;
}

.entry-content a {
  color: #2d6a4f;
  text-decoration: underline;
}

.entry-content a:hover {
  color: #52b788;
}

.entry-content h3 {
  padding-left: 8px;
  border-left: 3px solid #52b788;
}

/* ========================================
   ハンバーガーメニュー
======================================== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   No Image プレースホルダー
======================================== */
.post-card-thumbnail .no-thumbnail-inner {
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, #1b4332 0%, #1a4d35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.78rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ========================================
   アーカイブヘッダー
======================================== */
.archive-header {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border-left: 4px solid #52b788;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.archive-title {
  font-size: 1.35rem;
  color: #1b4332;
  font-weight: bold;
}

.archive-description {
  margin-top: 8px;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ========================================
   タグ（記事詳細）
======================================== */
.post-tags {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.post-tags-label {
  color: #888;
  font-size: 0.88rem;
}

.tag-badge {
  display: inline-block;
  background: #edf7f0;
  color: #2d6a4f;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  border: 1px solid #b7e4c7;
}

.tag-badge:hover {
  background: #1b4332;
  color: #fff;
  border-color: #1b4332;
  text-decoration: none;
}

/* タグ（記事カード）*/
.post-card-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ========================================
   前後の記事ナビゲーション
======================================== */
.post-navigation {
  margin-top: 28px;
}

.post-nav-links {
  display: flex;
  gap: 12px;
}

.post-nav-prev,
.post-nav-next {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.2s;
  border: 1px solid #eee;
}

.post-nav-prev:hover,
.post-nav-next:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: #52b788;
  text-decoration: none;
}

.post-nav-next {
  text-align: right;
}

.post-nav-empty {
  flex: 1;
}

.post-nav-label {
  font-size: 0.78rem;
  color: #aaa;
}

.post-nav-title {
  font-size: 0.92rem;
  color: #1b4332;
  font-weight: bold;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   一覧へ戻るボタン
======================================== */
.btn-back-to-list {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 20px;
  background: #f5f5f5;
  color: #333;
  border-radius: 4px;
  font-size: 0.88rem;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: background 0.2s, color 0.2s;
}

.btn-back-to-list:hover {
  background: #1b4332;
  color: #fff;
  border-color: #1b4332;
  text-decoration: none;
}

/* ========================================
   404ページ
======================================== */
.error-404 {
  text-align: center;
  padding: 60px 40px;
}

.error-404-code {
  font-size: 5rem;
  font-weight: bold;
  color: #e0e0e0;
  line-height: 1;
  margin-bottom: 8px;
}

.error-404 .post-title {
  font-size: 1.4rem;
  color: #555;
  margin-bottom: 12px;
}

.error-404-message {
  color: #888;
  margin-bottom: 8px;
}

.btn-back-home {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 28px;
  background: #1b4332;
  color: #fff;
  border-radius: 4px;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-back-home:hover {
  background: #52b788;
  color: #1b4332;
  text-decoration: none;
}

/* ========================================
   記事なし
======================================== */
.no-posts {
  padding: 48px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  color: #888;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ========================================
   レスポンシブ（タブレット）
======================================== */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .site-body {
    gap: 24px;
  }
}

/* ========================================
   レスポンシブ（スマートフォン）
======================================== */
@media (max-width: 767px) {
  /* ヘッダー */
  .site-header .container {
    position: relative;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-toggle {
    display: flex;
  }

  /* グローバルナビ */
  .global-nav {
    display: none;
    width: 100%;
    background: #1b4332;
    padding: 12px 0 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .global-nav.is-open {
    display: block;
  }

  .global-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .global-nav ul li a {
    display: block;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  /* レイアウト */
  .site-body {
    flex-direction: column;
    gap: 24px;
    padding: 24px 0;
  }

  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  /* 投稿カード */
  .post-card {
    flex-direction: column;
    gap: 12px;
  }

  .post-card-thumbnail {
    width: 100%;
  }

  .post-card-thumbnail img {
    height: 180px;
    width: 100%;
  }

  /* シングル記事 */
  .post-content {
    padding: 20px 16px;
  }

  .post-title {
    font-size: 1.35rem;
  }

  .entry-content h2 {
    font-size: 1.2rem;
    margin: 24px 0 10px;
  }

  .entry-content h3 {
    font-size: 1.05rem;
  }

  /* テーブルをスクロール可能に */
  .entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 前後記事ナビを縦積みに */
  .post-nav-links {
    flex-direction: column;
  }

  .post-nav-next {
    text-align: left;
  }

  .post-nav-empty {
    display: none;
  }

  /* 404ページ */
  .error-404 {
    padding: 40px 16px;
  }

  .error-404-code {
    font-size: 3.5rem;
  }

  /* No Image */
  .post-card-thumbnail .no-thumbnail-inner {
    height: 160px;
  }

  /* フッター縦積み */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 0 24px;
  }
}

/* タブレット：フッター2カラム */
@media (min-width: 768px) and (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-col-brand {
    grid-column: 1 / -1;
  }
}
