/* =============================================
   統一ニュースページスタイル Template
   全サイト共通のニュースページ用CSS
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e3a8a;
  --accent-color: #3b82f6;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-light);
  padding-top: 0;
  overflow-x: hidden;
  max-width: 100%;
}

main {
  min-height: calc(100vh - 400px);
}

article {
  background: white;
}

/* =============================================
   🚨 ヘッダー・ナビゲーションスタイル（必須！）
   ============================================= */

.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  justify-content: center;
}

.nav-item {
  list-style: none;
}

.nav-menu a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  transition: var(--transition);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* =============================================
   🚨 フッタースタイル（必須！）
   ============================================= */

.footer {
  background: #1e3c72;
  color: white;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 20px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
  color: white;
  border: none;
  padding: 0;
}

.footer-section h4 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #4CAF50;
}

.footer-section p {
  line-height: 1.6;
  opacity: 0.9;
  color: white;
}

.footer-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.footer-section ul a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-section ul a:hover {
  opacity: 1;
  color: #4CAF50;
}

.footer-bottom {
  background: #152a5c;
  text-align: center;
  padding: 20px;
}

.footer-bottom p {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 15px;
  color: white;
}

/* =============================================
   2カラムレイアウト (重要！)
   ============================================= */

.container {
  max-width: 1400px;
  margin: 100px auto 40px;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}

/* メインコンテンツ */
.main-content {
  background: var(--bg-white);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}

/* サイドバー */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  min-width: 0;
}

/* =============================================
   画像スタイル
   ============================================= */

.news-hero-image,
.featured-image,
.article-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
  display: block;
}

.news-thumbnail,
.news-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

/* =============================================
   テキストスタイル
   ============================================= */

.main-content h1,
.article-title {
  font-size: 2.2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.main-content h2,
.article-content h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1rem;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-color);
  font-weight: 600;
}

.main-content h3,
.article-content h3 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.main-content p,
.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 1.05em;
}

.main-content ul,
.main-content ol,
.article-content ul,
.article-content ol {
  margin: 1.5rem 0 1.5rem 2rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.main-content li,
.article-content li {
  margin-bottom: 0.8rem;
}

.main-content strong,
.article-content strong {
  color: var(--text-primary);
  font-weight: 700;
}

.main-content a,
.article-content a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
  transition: var(--transition);
}

.main-content a:hover,
.article-content a:hover {
  color: var(--accent-color);
}

/* =============================================
   記事メタ情報
   ============================================= */

.post-meta,
.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-light);
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.article-date {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-category {
  background: var(--accent-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.article-header {
  margin-bottom: 30px;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 20px;
}

.article-description {
  font-size: 1.1em;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* =============================================
   サイドバー要素
   ============================================= */

.sidebar-section,
.ad-space,
.ad-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.ad-space,
.ad-section {
  text-align: center;
  overflow: hidden;
}

.ad-space img,
.ad-placeholder img,
.ad-section img {
  max-width: 100%;
  height: auto;
  width: auto !important;
}

/* 記事コンテンツ内の全画像に対するレスポンシブ対応 */
.article-content img,
.main-content img {
  max-width: 100%;
  height: auto;
  width: auto !important;
}

.sidebar-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

/* 目次 */
.toc {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin-bottom: 0.6rem;
}

.toc a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.toc a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: 1rem;
}

.toc ul ul {
  margin-left: 1rem;
}

/* 関連記事 */
.related-links {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.related-links h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--secondary-color);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.related-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-links li {
  margin-bottom: 0.8rem;
}

.related-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.related-links a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: 1.2rem;
}

/* =============================================
   シェアボタン
   ============================================= */

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.share-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
}

.share-btn.twitter {
  background: #1da1f2;
}

.share-btn.twitter:hover {
  background: #0d8bd9;
  transform: translateY(-2px);
}

.share-btn.facebook {
  background: #1877f2;
}

.share-btn.facebook:hover {
  background: #0e66d4;
  transform: translateY(-2px);
}

/* =============================================
   ニュース一覧ページ
   ============================================= */

.news-header {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
  color: white;
  border-radius: 8px;
  margin: 2rem auto 3rem;
  max-width: 1400px;
}

.news-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: white;
  border: none;
  padding: 0;
}

.news-header p {
  font-size: 1.2rem;
  opacity: 0.95;
  color: white;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.news-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.news-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-title {
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-bottom: 0.8rem;
}

.news-card-date {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  display: block;
}

.news-card-excerpt {
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
  color: white;
  font-weight: bold;
  padding: 10px 24px;
  background-color: var(--accent-color);
  border-radius: 6px;
  transition: var(--transition);
  align-self: flex-start;
}

.read-more:hover {
  background-color: var(--secondary-color);
  transform: translateX(4px);
}

/* =============================================
   強調ボックス
   ============================================= */

.highlight-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 8px;
  margin: 30px 0;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.highlight-box h3 {
  color: white;
  margin-top: 0;
  margin-bottom: 15px;
  border: none;
  padding: 0;
}

.highlight-box p {
  margin-bottom: 10px;
  color: white;
}

.highlight-box ul {
  margin: 1rem 0 0 1.5rem;
}

.highlight-box li {
  color: white;
}

.cta-section {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  margin: 3rem 0;
}

.cta-section h3 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.cta-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* =============================================
   レスポンシブデザイン
   ============================================= */

@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 80px;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .main-content {
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    max-width: none;
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-container {
    padding: 1rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .logo-sub {
    font-size: 0.65rem;
  }

  .container {
    margin-top: 80px;
    padding: 0 1rem;
  }

  .main-content {
    padding: 1.5rem;
  }

  .main-content h1,
  .article-title {
    font-size: 1.75rem;
  }

  .main-content h2,
  .article-content h2 {
    font-size: 1.4rem;
  }

  .main-content h3,
  .article-content h3 {
    font-size: 1.2rem;
  }

  .news-hero-image,
  .featured-image {
    max-height: 250px;
  }

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

  .news-header h1 {
    font-size: 2rem;
  }

  .news-list {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .share-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
  }

  .main-content h1,
  .article-title {
    font-size: 1.5rem;
  }

  .news-header {
    padding: 2rem 1rem;
  }

  .sidebar-section,
  .ad-space,
  .toc {
    padding: 1rem;
  }
}
