/* ================================================================
   IGIA — レスポンシブスタイル
   Desktop-first。モバイルでの inline-style を !important で上書き。
   Breakpoints:
     900px  — ヘッダーナビ → ハンバーガー
     768px  — 2カラム以上グリッド → 1カラム
     480px  — 細部微調整
================================================================ */

/* ---- GLOBAL ---- */
@media (max-width: 768px) {
  .r-page-inner {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .r-section-pad {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
}

/* ---- HEADER ---- */
.hamburger-btn { display: none; }
.mobile-nav-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(12,43,33,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mobile-nav-overlay.is-open { display: flex; justify-content: flex-end; }
.mobile-nav-panel {
  background: #0c2b21;
  color: #f5f3ec;
  width: min(300px, 88vw);
  height: 100%;
  padding: 28px 28px 48px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-nav-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: #cfd6cf;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  margin-bottom: 32px;
}
.mobile-nav-link {
  display: block;
  color: #f5f3ec;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 16px 0;
  border-bottom: 1px solid rgba(245,243,236,0.1);
  font-family: 'Noto Sans JP', sans-serif;
}
.mobile-nav-cta {
  display: block;
  margin-top: 28px;
  background: #c2a04e;
  color: #0f3d2e;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  padding: 15px 20px;
  border-radius: 3px;
  text-decoration: none;
  font-family: 'Noto Sans JP', sans-serif;
}

@media (max-width: 900px) {
  .desktop-nav { display: none !important; }
  .hamburger-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    margin-left: auto;
  }
  .hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #0f3d2e;
    border-radius: 2px;
  }
}

/* ---- INDEX: HERO ---- */
@media (max-width: 768px) {
  .r-hero-grid {
    grid-template-columns: 1fr !important;
    padding-top: 52px !important;
    padding-bottom: 60px !important;
  }
  .r-hero-image { display: none !important; }
  .r-hero-h1 { font-size: 34px !important; line-height: 1.45 !important; }
  .r-hero-btns { flex-direction: column !important; }
  .r-hero-btns a { text-align: center !important; justify-content: center !important; }

  /* WHY IGIA — テキスト上・画像下の1カラム */
  .r-why-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  #why-igia-wrap { order: 2; aspect-ratio: 16 / 9 !important; }
  #why-igia-wrap > * { display: block; width: 100%; height: 100%; }

  /* FEATURES */
  .r-feature-grid { grid-template-columns: 1fr !important; }

  /* FLOW (index) — アイコン左・テキスト右の横並び1カラム */
  .r-flow-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .r-flow-connector { display: none !important; }
  .r-flow-step {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    text-align: left !important;
    background: #fffdf8;
    border: 1px solid rgba(15,61,46,0.1);
    border-radius: 8px;
    padding: 16px 20px !important;
  }
  .r-flow-icon { flex: none !important; margin: 0 !important; }

  /* MEMBERSHIP */
  .r-member-grid { grid-template-columns: 1fr !important; }

  /* FEES */
  .r-fees-grid { grid-template-columns: 1fr !important; align-items: stretch !important; }

  /* CTA */
  .r-cta-inner { flex-direction: column !important; gap: 28px !important; }
  .r-cta-buttons { flex-direction: column !important; }
  .r-cta-buttons a { text-align: center !important; justify-content: center !important; }

  /* NETWORK (index) */
  .r-network-inner { grid-template-columns: 1fr !important; gap: 40px !important; }
  .r-network-cards { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 480px) {
  .r-network-cards { grid-template-columns: 1fr !important; }
}

/* ---- CERTIFICATION FLOW: 1カラム縦並び ---- */
@media (max-width: 768px) {
  .r-cert-flow { flex-direction: column !important; }
  .r-cert-flow-item { min-width: unset !important; flex: none !important; width: 100% !important; }
}

/* ---- ABOUT ---- */
@media (max-width: 768px) {
  .r-about-biz-grid { grid-template-columns: 1fr !important; }
  .r-about-benefits-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  .r-about-benefits-grid { grid-template-columns: 1fr !important; }
}

/* ---- CERTIFICATION ---- */
@media (max-width: 768px) {
  .r-cert-elig-grid { grid-template-columns: 1fr !important; }
  .r-cert-elig-cards { grid-template-columns: 1fr 1fr !important; }
  .r-cert-subject-grid { grid-template-columns: 1fr !important; }
  .r-cert-exam-grid { grid-template-columns: 1fr !important; }
  /* Fee table → stacked rows */
  .r-cert-fee-header { display: none !important; }
  .r-cert-fee-row {
    grid-template-columns: 1fr !important;
    border-bottom: 2px solid rgba(15,61,46,0.18) !important;
  }
  .r-cert-fee-name { font-weight: 700 !important; padding-bottom: 4px !important; }
  .r-cert-fee-amount { text-align: left !important; font-size: 22px !important; }
}
@media (max-width: 480px) {
  .r-cert-elig-cards { grid-template-columns: 1fr !important; }
}

/* ---- ORGANIZATION ---- */
@media (max-width: 768px) {
  .r-org-profile-grid { grid-template-columns: 1fr !important; }
  .r-org-network-grid { grid-template-columns: 1fr !important; }
  .r-org-profile-card { flex-direction: column !important; }
  .r-org-photo { width: 80px !important; height: 100px !important; }
}

/* ---- CONTACT ---- */
@media (max-width: 768px) {
  .r-contact-grid { grid-template-columns: 1fr !important; }
}

/* ---- FOOTER ---- */
@media (max-width: 768px) {
  .r-footer-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .r-footer-bottom {
    flex-direction: column !important;
    gap: 6px !important;
    text-align: center !important;
  }
}

/* ---- DEFINITION TABLE (協会案内・特商法) ---- */
@media (max-width: 768px) {
  .r-def-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .r-def-row > div:first-child {
    padding-bottom: 4px !important;
    border-bottom: none !important;
    font-size: 12px !important;
    color: #9a7d2e !important;
    letter-spacing: 0.1em;
  }
  .r-def-row > div:last-child {
    padding-top: 4px !important;
    padding-bottom: 20px !important;
  }
}

/* ---- PAGE HEROS (all sub-pages) ---- */
@media (max-width: 768px) {
  .r-page-hero-h1 { font-size: 30px !important; }
  .r-page-hero-inner { padding-top: 48px !important; padding-bottom: 52px !important; }
}

/* ---- SEMINARS ---- */
@media (max-width: 768px) {
  .r-seminar-card { grid-template-columns: 1fr !important; }
  .r-seminar-date-box { flex-direction: row !important; gap: 16px !important; padding: 16px 20px !important; align-items: center !important; justify-content: flex-start !important; }
}

/* ---- GENERAL TYPOGRAPHY ---- */
@media (max-width: 768px) {
  .r-h2 { font-size: 24px !important; }
  .r-h3 { font-size: 18px !important; }
}
