/*──────────────────────────────────────────────────────────────*/
/* 1. Variables */
/*──────────────────────────────────────────────────────────────*/
:root {
  --main-color: #009688;
  --accent-color: #ffc107;
  --bg-color: #ffffff;
}

/*──────────────────────────────────────────────────────────────*/
/* 2. Reset & Base */
/*──────────────────────────────────────────────────────────────*/
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-color);
  color: #333;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*──────────────────────────────────────────────────────────────*/
/* 3. Layout Containers */
/*──────────────────────────────────────────────────────────────*/
main {
  padding-top: 0; /* Offset for fixed navbar */
}

section {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 0 1rem;
}

section h2 {
  border-bottom: 2px solid var(--main-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/*──────────────*/
/* Markdown画像・動画のデフォルト整形 */
/*──────────────*/

section img,
section video,
section iframe {
  display: block;
  margin: 2rem auto;  /* 上下余白＋中央寄せ */
  max-width: 100%;    /* セクション幅を超えない */
  height: auto;
  border-radius: 8px; /* お好みで角丸を追加 */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* お好みで影を追加 */
}

/* iframe で YouTube をスマホ対応に */
section iframe {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  height: auto;
}

/*──────────────────────────────────────────────────────────────*/
/* Figure とキャプションの中央揃え */
/*──────────────────────────────────────────────────────────────*/
figure {
  margin: 2rem auto; /* 図全体の上下余白と中央揃え */
  text-align: center;
}

figure figcaption {
  margin-top: 0.5rem;
  text-align: center; /* キャプションを中央揃え */
}

/*──────────────────────────────────────────────────────────────*/
/* 3.1. カード・ニュースサムネイル画像の上下余白をリセット */
/*──────────────────────────────────────────────────────────────*/
.news-thumbnail img,
.card img,
.activity-visual img {
  margin: 0; /* デフォルトの上下余白を無効化 */
}

/*──────────────────────────────────────────────────────────────*/
/* 4. Navbar & Menu */
/*──────────────────────────────────────────────────────────────*/
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255,255,255,0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.navbar img.logo {
  height: 40px;
}

.hamburger {
  display: block;
  font-size: 2rem;
  cursor: pointer;
  color: var(--main-color);
  z-index: 1001; /* メニューより上に */
  position: relative;
}

/* Menu (mobile dropdown) */
.menu {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background-color: rgba(255,255,255,0.9);
  padding: 1rem;
  align-items: flex-end;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  z-index: 2000;
}

.menu.active {
  max-height: 500px;
  opacity: 1;
}

.menu a {
  margin: 1rem 0;
  color: var(--main-color);
  text-decoration: none;
  font-size: 1.2rem;
  width: min(80%,250px);
  text-align: left;
}

/* Navbar links (desktop) */
.navbar .menu a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--main-color);
  font-weight: bold;
}

/*──────────────────────────────────────────────────────────────*/
/* 5. Hero Header */
/*──────────────────────────────────────────────────────────────*/
.hero-header {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  /* background: url('/challenge-club-homepage/images/common/challenge-club-backpanel.png') center/cover no-repeat;*/
  background: url('../images/common/challenge-club-backpanel.png') center/cover no-repeat;
  color: #fff;
  text-align: center;
  font-weight: bold;
  overflow: hidden;
  margin-top: 0;
  z-index: 0;

  /* 中央揃え用のFlexbox */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  height: 40vh; /* 画面の40%の高さを確保 */
  min-height: 200px; /* モバイルでもある程度の高さ確保 */
}

.hero-header::before,
header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.7);
  z-index: 0;
}

header h1,
header p,
.hero-header h1,
.hero-header p {
  position: relative;
  z-index: 1;
}

header h1,
.hero-header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

header p,
.hero-header p {
  font-size: 1.5rem;
}

/*──────────────────────────────────────────────────────────────*/
/* 6. Code Blocks */
/*──────────────────────────────────────────────────────────────*/
pre,
code {
  background-color: #f4f4f4;
  color: #000;
  font-family: Consolas,'Courier New',monospace;
  font-size: 0.95em;
}

pre {
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}

code {
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/*──────────────────────────────────────────────────────────────*/
/* 7. News List */
/*──────────────────────────────────────────────────────────────*/
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 auto;
  max-width: 800px;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8em;
  padding: 0.4em 0;
  border-bottom: 1px solid #ccc;
  margin: 0;
}

.news-thumbnail img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-title {
  margin: 0 0 0.3em;
  font-size: 1em;
  font-weight: bold;
  line-height: 1.3;
}

.news-title a {
  color: #222;
  text-decoration: none;
}

.news-title a:hover {
  text-decoration: underline;
}

.news-meta {
  font-size: 0.9em;
  color: #777;
  margin: 0.1em 0 0;
}

.news-tags {
  margin: 0.3em 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.news-excerpt {
  display: block;  
  margin-top: 0.2em; 
}

/*──────────────────────────────────────────────────────────────*/
/* 8. Buttons */
/*──────────────────────────────────────────────────────────────*/
.more-button,
.contact-button {
  display: inline-block;
  padding: 0.6em 1.2em;
  background-color: var(--main-color);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.more-button:hover,
.contact-button:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}

.more-button:focus,
.contact-button:focus {
  outline: 2px solid var(--main-color);
  outline-offset: 2px;
}

/*──────────────────────────────────────────────────────────────*/
/* 9. Cards */
/*──────────────────────────────────────────────────────────────*/
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 1.5rem;
  justify-items: center;
}

.card {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
}

.card-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--main-color);
}

.card-content p {
  font-size: 0.9rem;
  color: #555;
}

/*──────────────────────────────────────────────────────────────*/
/* 10. Tags & Badges */
/*──────────────────────────────────────────────────────────────*/
.tag-pill {
  display: inline-block;
  padding: 0.2em 0.6em;
  margin: 0;
  font-size: 0.9em;
  border: 1px solid #ccc;
  border-radius: 16px;
  background-color: #f8f8f8;
  color: #333;
  text-decoration: none;
  transition: background-color .2s,color .2s;
}

.tag-pill:hover {
  background-color: var(--main-color);
  color: #fff;
  border-color: var(--main-color);
}

.badge {
  background-color: #4caf50;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  display: inline-block;
}

/*──────────────────────────────────────────────────────────────*/
/* 11. Footer */
/*──────────────────────────────────────────────────────────────*/
footer {
  position: relative;
  background: url('/mnt/data/e5999445-ee6b-463e-9c1f-6c00808db00a.png') center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 4rem 1rem;
  font-size: 0.9rem;
}

.footer-contact {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.footer-links {
  margin-top: 2rem;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.7);
  z-index: 0;
}

footer p,
footer a {
  position: relative;
  z-index: 1;
}

footer a {
  display: inline-block;
  margin: 0.3rem;
  color: var(--accent-color);
  text-decoration: none;
}

/*──────────────────────────────────────────────────────────────*/
/* 12. QR & Icons */
/*──────────────────────────────────────────────────────────────*/
.qr-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.qr-block {
  text-align: center;
}

.qr-block img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  transition: transform .3s ease, box-shadow .3s ease;
}

.qr-block img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

.qr-block p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-row {
  display: none;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.icon-row a img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  transition: transform .2s ease;
}

.icon-row a img:hover {
  transform: scale(1.1);
}

/*──────────────────────────────────────────────────────────────*/
/* 13. Activity Pages */
/*──────────────────────────────────────────────────────────────*/
.activity-visual {
  text-align: center;
  margin: 2rem 0;
}

.activity-visual img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.activity-header {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: center;
  padding: 4rem 1rem;
}

.activity-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 0;
}

.activity-header h1,
.activity-header p {
  position: relative;
  z-index: 1;
}

.activity-header h1 {
  margin: 0;
  font-size: 2.5rem;
}

.activity-header p {
  margin-top: 0.5rem;
  font-size: 1.2rem;
}

/*──────────────────────────────────────────────────────────────*/
/* 14. Responsive: max-width 600px */
/*──────────────────────────────────────────────────────────────*/
@media (max-width: 600px) {
    /* スマホ：カードテキストサイズ調整 */
    .card-content {
      padding: 0.8rem;
    }
    .card-content h3 {
      font-size: 1rem;
    }
    .card-content p {
      font-size: 0.85rem;
    }
  .navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .menu,
  .navbar .menu {
    max-height: 0;
    opacity: 0;
  }

  .menu.active,
  .navbar .menu.active {
    max-height: 500px;
    opacity: 1;
  }

  .menu a {
    margin: 0.5rem 0;
  }

  header h1,
  .hero-header h1 {
    font-size: 2rem;
  }

  header p,
  .hero-header p {
    font-size: 1rem;
  }

  /* 画像領域を小さくする */
  .hero-header {
    height: 20vh;
    min-height: 150px;
  }

  /* スマホではニュース概要を非表示*/
  .news-excerpt {
    display: none; 
  }
  
  .card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .card {
    width: 100%;
    max-width: 250px;
    margin-bottom: 1rem;
  }

  /* スマホ：カード画像をPCと同じ縦横比に */
  .card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  /* スマホ：カード画像をPCと同じ縦横比に */
  .card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  .qr-desktop {
    display: none;
  }

  .qr-mobile {
    display: flex;
  }

  .qr-container img {
    width: 90px;
    height: 90px;
  }

  /* スマホ: ページ左右の余白を縮小 */
  section {
    padding: 0 0.5rem;
  }
}