/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background-color: #f4f4f4;
  color: #000000;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

body.dark {
  background-color: #121212;
  color: #f0f0f0;
}

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

/* Header */
header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border-radius: 9999px;
  padding: 1rem 2rem;
  width: 97%;
  max-width: 100vw;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
}

body.dark header {
  background: rgba(30, 30, 30, 0.4);
}

header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  color: #2e8fff;
}

header h1 a {
  color: #2e8fff;
  font-weight: 700;
  font-size: 1.4rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

header h1 a:hover {
  color: #1a5edb;
  text-shadow: 2px 2px 5px rgba(26, 94, 219, 0.7);
  cursor: pointer;
}

header h1 img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* Navigation */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav a {
  background-color: transparent;
  color: #000000;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav a:hover {
  background-color: #2679d5;
  color: #ffffff;
}

body.dark nav a {
  color: #dddddd;
}

body.dark nav a:hover {
  background-color: #2679d5;
  color: #ffffff;
}

/* Containers */
.container {
  max-width: 1100px;
  margin: 20px auto 2rem;
  padding: 0 2rem;
}

/* Section Headings */
h2 {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding: 0.5rem 1rem;
  background-color: #2679d5;
  color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  gap: 0.5rem;
  backdrop-filter: blur(5px);
  transition: background 0.3s;
}

body.dark h2 {
  background: rgba(40, 40, 40, 0.6);
}

/* Grid and Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  display: block;
  background-color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.1rem;
  color: #ffffff;
  transition: transform 0.2s ease, background-color 0.3s;
  text-decoration: none;
}

.card:hover {
  transform: translateY(-5px);
  background-color: #ffffff;
  color: #000000;
}

.card img {
  width: 100%;
  border-radius: 8px;
}

.card h3 {
  margin: 1rem 0;
  background-color: #2e8fff;
  color: #ffffff;
  padding: 0.4em 1em;
  border-radius: 10px;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.card p {
  color: #666666;
  margin-bottom: 1em;
}

.card h2 {
  font-size: 1.6rem;
  margin: 1.5rem 0 1rem;
  color: #2679d5;
}

body.dark .card {
  background: #1e1e1e;
  color: #ffffff;
}

body.dark .card h3 {
  color: #ffffff;
}

body.dark .card p {
  color: #cccccc;
}

/* Hero */
.hero {
  position: relative;
  margin-top: 100px;
  height: 300px;
  overflow: hidden;
}

.hero-image {
  height: 100%;
  position: relative;
}

.hero-image::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f4f4f4);
  transition: background 0.3s;
  pointer-events: none;
}

body.dark .hero-image::after {
  background: linear-gradient(to bottom, rgba(18, 18, 18, 0), #121212);
}

.hero-title {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  color: #2679d5;
  z-index: 2;
  transition: background-color 0.3s;
}

body.dark .hero-title {
  background-color: rgba(18, 18, 18, 0.7);
}

/* SNS Buttons */
.sns-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.sns-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 9999px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  color: #ffffff;
  background-color: #555555;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s, transform 0.2s;
}

.sns-btn:hover {
  transform: translateY(-3px);
}

.sns-icon,
.sns-icons {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Buttons */
.button {
  display: inline-block;
  background-color: #2e8fff; /* 水色 */
  color: #222222;
  font-weight: bold;
  text-decoration: none;
  padding: 1rem 2rem;
  margin: 0.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, background-color 0.2s;
}

.button:hover {
  background-color: #1a5edb; /* 濃い水色 */
  transform: scale(1.05);
}

footer .button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #555555;
  color: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

footer .button:hover {
  background-color: #1a5edb;
  transform: translateY(-3px);
  cursor: pointer;
}

/* Footer */
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: #2679d5;
  color: #ffffff;
  text-align: center;
  margin-top: 2rem;
}

/* Utilities */
.toggle-mode {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-top: -0.5rem;
  color: #ffffff;
}

.back-link {
  display: inline-block;
  margin-top: 1em;
  font-weight: bold;
  color: #8000aa;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

code {
  background-color: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.95em;
}

body.dark code {
  background-color: #333333;
  color: #f0f0f0;
}

/* Tile */
.tile-section h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 2rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem;
}

.tile-card {
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #222222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, background-color 0.3s;
}

.tile-card:hover {
  transform: translateY(-6px);
  background-color: #f0f8ff;
}

.tile-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.tile-card h3 {
  font-size: 1.2rem;
  padding: 1rem 1rem 0.5rem;
  color: #2679d5;
}

.tile-card p {
  font-size: 0.95rem;
  padding: 0 1rem 1rem;
  color: #555555;
}

body.dark .tile-card {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

body.dark .tile-card:hover {
  background-color: #2a2a2a;
}

body.dark .tile-card h3 {
  color: #2e8fff;
}

body.dark .tile-card p {
  color: #cccccc;
}

/* リンク集用カードラッパー */
/* .link-cardsをgridにして自動でタイル並び */
.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* カード自体のスタイル */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fefefe;
  border-radius: 12px;
  box-shadow: 0 0 10px rgb(0 0 0 / 0.08);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: #000000;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 0 15px rgb(0 0 0 / 0.15);
}

.card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.7rem;
}

.title {
  font-weight: 700;
  font-size: 1.3rem; /* 少し大きめ */
  margin-bottom: 0.3rem;
}

.description {
  font-size: 1rem;
  color: #333333;
  text-align: center;
  line-height: 1.3;
}

/* ダークモードの軽い対応例 */
body.dark .card {
  background: #222222;
  color: #eeeeee;
}

body.dark .description {
  color: #cccccc;
}

/* ハンバーガーメニューのボタン */
.hamburger {
  display: none; /* デフォルトは非表示 */
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10000;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background-color: #2e8fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ダークモードのハンバーガー色 */
body.dark .hamburger span {
  background-color: #80aaff;
}

/* ハンバーガーボタン開閉アニメーション */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ナビメニュー */
.nav-menu {
  display: flex;
  gap: 0.5rem;
  transition: max-height 0.3s ease;
}

.nav-menu a {
  background-color: transparent;
  color: #000000;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ダークモードリンク色 */
body.dark .nav-menu a {
  color: #dddddd;
}

/* ホバー効果 */
.nav-menu a:hover {
  background-color: #2679d5;
  color: #ffffff;
}

/* スマホ対応 - 768px以下 */
@media (max-width: 768px) {
  /* ハンバーガーボタン表示 */
  .hamburger {
    display: flex;
  }

  /* メニューは縦に並べて隠す */
  .nav-menu {
    position: fixed;
    top: 72px; /* ヘッダー高さ+少し余白 */
    right: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    width: 200px;
    z-index: 9998;
  }

  /* ダークモード背景 */
  body.dark .nav-menu {
    background-color: rgba(30, 30, 30, 0.95);
  }

  /* メニュー開いた時 */
  .nav-menu.open {
    max-height: 500px; /* 必要な高さに合わせて調整可 */
    transition: max-height 0.4s ease;
  }

  /* メニュー内リンク */
  .nav-menu a {
    padding: 1rem 1.5rem;
    border-radius: 12px;
  }
}

.content-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 140px;
}
.article {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.post-meta {
  font-size: 0.9rem;
  color: #666666;
  margin-bottom: 1rem;
}
.share-buttons {
  margin-bottom: 1rem;
}
.categories a {
  font-size: 0.9rem;
  color: #2679d5;
  margin-right: 0.5rem;
}
.related-posts .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.author-box {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f4f4f4;
  border-radius: 8px;
  margin-top: 2rem;
}
.author-box img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}
.comments-section {
  margin-top: 2rem;
}
.comment {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.comment-form textarea {
  width: 100%;
  height: 100px;
  padding: 0.5rem;
  border: 1px solid #cccccc;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.sidebar .widget {
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}
.search-box input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #dddddd;
  border-radius: 4px;
}
