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

:root {
  --header-height-pc: 72px;
  --header-height-sp: 44px;
}


body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo,
    sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  /* Added padding-top for desktop to prevent fixed header from covering hero section */
  padding-top: var(--header-height-pc);
}

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

/* =====================
   Header
===================== */
.site-header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo-area {
  display: flex;
  align-items: center;
}

.logo-area img {
  height: 40px;
  display: block;
}

.home-link {
  margin-left: 15px;
  color: #0073aa;
  text-decoration: none;
  font-size: 14px;
}

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

.trial-button {
  background: #ff6b35;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: bold;
  transition: opacity 0.2s;
}

.trial-button:hover {
  opacity: 0.9;
}

/* =====================
   Hero Section
===================== */
.hero {
  background: #0b6edc;
  color: white;
  padding: 40px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-lead {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

.hero-lead strong {
  color: #ffd700;
  font-weight: 700;
}

/* =====================
   Intro Section
===================== */
.intro {
  padding: 40px 20px;
  background-color: #fff;
}

.intro h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #333;
  text-align: center;
}

.intro p {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 15px;
  text-align: center;
}

.intro strong {
  color: #667eea;
  font-weight: 600;
}

/* =====================
   Filter Section
===================== */
.filter-area {
  position: sticky;
  top: var(--header-height-pc);
  z-index: 90;
  padding: 10px 0 10px;
  background-color: #f0f2f5;
  scroll-margin-top: 100px; /* ヘッダーの高さ分 */
}

.filter-area h2 {
  font-size: 1.2rem;
  margin-bottom: 0px;
  text-align: center;
  color: #333;
}

.filter-desc {
  text-align: center;
  color: #666;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 5px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-btn {
  padding: 12px 24px;
  border: 1px solid #6f85e9;
  background-color: #fff;
  color: #667eea;
  border-radius: 15px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-btn.active {
  background-color: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}



/* =====================
   Cards Grid (Mobile First)
===================== */
.cards-wrapper {
  padding: 24px 12px;
  background-color: #fff;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

.card.hidden {
  display: none;
}

/* Card Image */
.card-img {
  padding: 0;
  margin: 0;
  height: auto;
  min-height: 0;
  display: block;
}

.card-img img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Card Title */
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
  text-align: center;
}

/* Card Category */
.card-category {
  display: inline-block;
  padding: 3px 10px;
  background-color: #f0f2f5;
  color: #666;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

/* Card Description */
.card-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
  line-height: 1.55;
}

/* Card Examples */
.card-examples {
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.card-examples h4 {
  font-size: 1.1rem;
  color: #667eea;
  margin-bottom: 4px;
  font-weight: 800;
}

.card-examples ul {
  list-style: none;
  font-size: 1.1rem;
}

.card-examples li {
  margin-bottom: 2px;
  line-height: 1.3; 
  color: #333;
}

.card-examples li:before {
  content: "✓ ";
  color: #667eea;
  font-weight: bold;
  margin-right: 4px;
}

.ok {
  color: #2ecc71;
  font-weight: 600;
}

.ng {
  color: #e53935;
  font-weight: bold;
  margin: 0;
  margin-left: 0;
  padding: 0;
}

.ng::before,
.ng::after {
  content: none;
}


/* =====================
   Card Usage Area
===================== */
.card-usage {
  margin-top: 14px;
  font-size: 1.1rem;
  text-align: left;
}

.card-usage h4 {
  font-size: 0.85rem;
  color: red;
  margin-bottom: 4px;
  font-weight: 800;
}

.usage-wrong div,
.usage-correct div {
  display: block;       /* div をブロックじゃなくインライン扱いに */
  text-align: left;      /* 左揃え */
  white-space: normal;
  word-break: break-word;
  margin: 0;             /* 余計な margin を消す */
  padding: 0;            /* 余計な padding を消す */
  line-height: 1.3; 
}

.usage-wrong .ng {
  display: inline;       /* span の幅を文字にぴったり合わせる */
}
/* NG (Wrong) Usage */
.usage-wrong {
  color: #000;
  margin-bottom: 10px;
}

.usage-wrong div::before {
  content: "×";
  display: inline-block;
  margin-right: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #e5534b;
}

/* =====================
   Explanation Section
===================== */
.explanation {
  padding: 60px 20px;
  background-color: #f8f9fa;
}

.explanation h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
}

.explanation p {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 20px;
}

.explanation strong {
  color: #667eea;
  font-weight: 600;
}

.explanation em {
  background-color: #fff3cd;
  padding: 2px 6px;
  border-radius: 3px;
  font-style: normal;
  font-weight: 600;
}

.example-box {
  max-width: 700px;
  margin: 30px auto;
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  border: 2px solid #667eea;
}

.example-box h3 {
  font-size: 1.3rem;
  color: #667eea;
  margin-bottom: 5px;
}

.example-box ul {
  list-style: none;
  font-size: 1.05rem;
}

.example-box li {
  margin-bottom: 4px;
  padding: 4px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

/* ❌ 間違い部分を赤太字 */
.highlight-red {
  color: #e74c3c; /* 赤 */
  font-weight: bold;
}

/* ✅ 正しい部分を緑太字 */
.highlight-green {
  color: #27ae60; /* 緑 */
  font-weight: bold;
}

/* 行頭アイコン */
li.wrong::before {
  content: "❌ ";
  color: #e74c3c;
  font-weight: bold;
}

li.correct::before {
  content: "✅ ";
  color: #27ae60;
  font-weight: bold;
}

/* =====================
   cta learning Section
===================== */
.cta-learning {
  background: #ffffff;
  padding: 72px 16px;
  text-align: center;
}

.cta-learning h2 {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.cta-learning p {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 36px;
  color: #333;
}

.cta-button-wrap {
  display: flex;
  justify-content: center;
}

.trial-button cta-trial {
  display: inline-block;
  padding: 20px 56px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 999px;
  background: #2b6cff;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(43,108,255,0.3);
  transition: all 0.25s ease;
}

.trial-button.big:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(43,108,255,0.4);
}

.section-wave {
  background: #fff;
  margin: 0;
}

.section-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

.section-wave path {
  fill: none;
  stroke: #d8d8d8;        /* 薄いグレー */
  stroke-width: 2;
  stroke-dasharray: 5 7;  /* 点線感 */
}

/* =====================
   FAQ Section
===================== */
.faq {
  padding: 60px 20px;
  background-color: #fff;
}

.faq h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
  color: #333;
}

.faq dl {
  max-width: 800px;
  margin: 0 auto;
}

.faq dt {
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  margin-top: 25px;
  padding: 15px;
  background-color: #f8f9fa;
  border-left: 4px solid #667eea;
  border-radius: 6px;
}

.faq dd {
  font-size: 1.05rem;
  color: #555;
  margin-left: 20px;
  margin-bottom: 15px;
  line-height: 1.7;
}

/* =====================
   Footer
===================== */
.footer {
  background-color: #2c3e50;
  color: #fff;
  padding: 40px 20px 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo img {
  height: 35px;
  filter: brightness(0) invert(1);
}

.footer-nav {
  margin-top: 16px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #ecf0f1;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #3498db;
}

.footer-bottom {
  text-align: center;
  padding-top: 0px;
  border-top: 1px solid #34495e;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: #95a5a6;
}

/* =====================
   Top Button
===================== */
.top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #667eea;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 99;
}

.top-btn.show {
  opacity: 1;
  visibility: visible;
}

.top-btn:hover {
  background-color: #764ba2;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* =====================
   Responsive Design
===================== */

/* =====================
   Default (601px〜 PC & Tablet)
===================== */

/* レイアウト */
.cards-grid {
  grid-template-columns: repeat(3, 1fr);
}

.card-img img {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Hero */
.hero h1 {
  font-size: 2rem;
}

.hero-lead {
  font-size: 1rem;
}

.intro h2 {
  font-size: 1.6rem;
}

/* カード */
.card {
  padding: 18px;
}

/* ヘッダー・フッター */
.header .container {
  flex-direction: column;
  gap: 15px;
}

.footer-content {
  flex-direction: column;
  text-align: center;
}

.footer-nav {
  justify-content: center;
}

/* フィルターボタン */
.filter-btn {
  font-size: 0.9rem;
  padding: 4px 10px;
}

.top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;

  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.top-btn.show {
  opacity: 1;
  pointer-events: auto;
}



@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}



/* =====================
   Mobile (〜600px)
===================== */
@media (max-width: 600px) {

  /* body & header */
  body {
    padding-top: var(--header-height-sp);
    padding-left: 0;
    padding-right: 0;
  }

  .site-header {
    height: 44px;
    padding: 0 14px;
  }

  .header-inner {
    padding: 6px 12px;
  }

  .logo-area img {
    height: 28px;
  }

  .home-link {
    font-size: 12px;
    margin-left: 6px;
    white-space: nowrap;
  }

  .trial-button {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 16px;
    white-space: nowrap;
  }

  /* Hero */
  .hero {
    padding: 20px 16px 22px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-en {
    font-size: 1rem;
  }

  .hero-sub {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  /* フィルター */

  .filter-area {
    top: var(--header-height-sp);
    margin: 0 auto 20px;
    padding: 12px;
  }

  .filter-area h2 {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  .filter-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .filter-note {
    font-size: 11px;
  }

  .category-toggle {
    display: block;
  }

  /* ボタンを小さくして横書きに */
  .filter-btn {
    font-size: 0.8rem; /* 適宜調整 */
    padding: 4px 4px; /* 狭い画面向けに縮小 */
    white-space: nowrap; /* 改行させない */
    border-radius: 6px;      /* 丸みを小さく */
    font-variant-east-asian: half-width; /* 全角記号を半角に変換 */
  }

  .filter-btn .type-label {
    display: none;
  }
  
  /* フィルター全体の横並び調整 */
  .filters {
    max-width: 100%;   /* 画面いっぱいに広げる */
    margin: 0 4px;     /* 左右の余白を小さく */
    flex-wrap: nowrap; /* 横1列 */
    gap: 4px;
    justify-content: center;
    overflow-x: auto; /* 横スクロール可能 */
    -webkit-overflow-scrolling: touch; /* スムーズスクロール */
  }


  
  /* カード */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 8px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    padding: 10px 10px 12px;
  }

  .card-img img {
    width: 100%;
    max-width: 160px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }

  .expression {
    font-size: 1.05rem;
  }

  .meaning {
    font-size: 0.9rem;
  }

  .note {
    font-size: 0.8rem;
    background: #e9eef5;
  }

  #pageTopBtn {
    bottom: 10px;
  }

  .footer {
    padding: 12px 8px;
    gap: 10;
  }
  .footer-content {
    padding: 0 8px;
    gap: 0;
  }
  .footer-nav {
    padding: 0;
    gap: 4;
  }
  .footer-nav a {
    padding: 2px 4px;
    line-height: 0.1;
    font-size: 12px;
  }

  .footer-nav ul {
    padding-left: 0;
    margin: 0;
    gap: 4px 8px;
  }
}

/* =====================
   Extra Small Mobile (〜380px)
===================== */
@media (max-width: 380px) {

/* ボタンを小さくして横書きに */
  .filter-btn {
    font-size: 0.65rem; /* 適宜調整 */
  }

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