* {
    box-sizing: border-box;
}

html { scroll-behavior: smooth;}

/* ← A: 固定フッター(.sidebar)の高さを変える場合はここだけ変更 */
:root { --bottom-bar-h: 60px; }

html, body {
    margin: 0;
    padding: 0;
    font-family:"Noto Sans JP", sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: row;
    position: relative;
}

p {
    font-size:20px;
    color: #222;
}

.big {
    font-size: 1.35em;
}

h2 {
    font-size: 24px;
    color: #47b459;
    font-weight: bold;
    line-height: 1.5em;
}

h3 {
    font-size: 20px;
    font-weight: 500;
}

h4{
    font-size:18px;
}

li{
    color:#222;
}

.red{
    color:#ef4a25;
}

.green {
    color: #47b459;
}

.small {
    font-size: 0.8em;
}


.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.material-symbols-outlined.fill {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.main {
    display: flex;
    width: 95vw;
    height: 100vh;
    flex-shrink: 0;
    z-index: 1;
}

.title-section {
    width: 60vw;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.title-section h1 img {
    max-width: 100%;
    max-height: 100%;
}

.scroll-indicator { display: none; }

description-section {
    width: 35vw;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.desc-box {
    padding: 30px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.desc-box:nth-child(2n){ background:#f2f7f3; }
.desc-box:hover { background: #f0f0f0; }
.desc-box:nth-child(2n):hover{ background: #d8efd8; }

.desc-box::after {
    font-family: 'Material Symbols Outlined';
    content: '\e5cc';
    position: absolute;
    bottom: 15px;
    right: 15px;
    transition: transform 0.3s;
    color: #47b459;
    font-size:22px;
}
.desc-box:hover::after { transform: translateX(5px); }

.desc-box h2 { margin-bottom: 7px; }

.sidebar {
    width: 5vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: #222;
    color: white;
    padding: 20px 0;
    flex-shrink: 0;
    z-index: 1002;
    position: fixed;
    bottom: 0;
    right: 0;
}

.menu-btn, .contact-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.menu-btn .material-symbols-outlined {
    font-size: 45px;
    color: #fff;
    line-height: 0.75em;
}

.menu-btn p, .contact-btn p {
    font-size: 12px;
    line-height: 1em;
    color: #fff;
}

.contact-btn .material-symbols-outlined {
    font-size: 45px;
    color: #fff;
}

.contact-btn a { text-align: center; }

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color:rgb(71 180 89 / 75%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.menu-overlay.active { opacity: 1; z-index:999; }

.menu-panel {
    position: fixed;
    top: 0;
    right: -35vw;
    width: 35vw;
    height: 100%;
    background: #fff;
    color: #222;
    padding: 20px;
    transition: right 0.3s;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.menu-panel.active { right: 5vw; }

.menu-panel ul { list-style: none; padding: 0; }
.menu-panel li {
    font-size: 22px;
    font-weight: bold;
    border-bottom: 1px solid #222;
    padding: 1em 0;
}
.menu-panel li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.menu-panel li a .arrow {
    transition: transform 0.3s ease;
    color:#47b459;
    font-size: 32px;
}
.menu-panel li a:hover .arrow { transform: translateX(5px); }

.menu-content { flex-grow: 1; }

.menu-logo img{
    width: 100%;
    max-width: 140px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.menu-panel a, .desc-box a, .contact-btn a {
    color: inherit;
    text-decoration: none;
}

/* ------------------ 768px以下の基本調整（A: 下パディング） ------------------ */
@media (max-width: 768px) {
    html, body { height: auto; overflow: auto; }

    body {
        flex-direction: column;
        /* ← A: 固定フッター＋セーフエリア分の逃げ */
        padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom, 0px));
    }

    .main {
        width: 100vw;
        height: auto;
        flex-direction: column;
    }

    .title-section, .description-section { width: 100%; height: auto; }
    .description-section { padding: 10px; }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
        z-index: auto;
    }

    .menu-panel { right: 0; }
}

@media (max-width: 1200px) {
  html, body { height: auto; overflow: auto; }

  h3 { font-size: 18px; }
  h4 { font-size:16px; }

  .main {
    flex-direction: column;
    width: calc(100vw - 75px); /* サイドバー除いた幅 */
    height: auto;
    margin-right: 75px;
  }

  .title-section {
    width: 100%;
    height: auto;
    padding: 0;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
  }

  .title-section h1 { width: 100%; margin: 0; }
  .title-section h1 img { width: 100%; height: auto; display: block; object-fit: contain; }

  .scroll-indicator {
    display:block;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    color: #fff;
    animation: bounce 1.5s infinite;
    z-index: 10;
    pointer-events: none;
  }
  @keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 10px); }
  }
  .scroll-indicator span { font-size: 50px; }

  .description-section { display: flex; flex-direction: column; gap: 20px; padding: 20px; }
  .desc-box { width: 100%; padding: 20px; }

  .sidebar {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 75px;
    height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 1002;
    background: #222;
    color: white;
    padding: 20px 0;
  }

  .description-section { flex-direction: row; flex-wrap: wrap; padding: 20px; gap: 20px; }
  .desc-box { flex: 1 1 calc(50% - 20px); padding: 20px; min-width: 300px; }
  .menu-panel.active { right: 75px; }
}

@media (max-width: 768px) {
  body { flex-direction: column; }

  h2 { font-size: 18px; }
  p  { font-size: 14px; }

  .main {
    width: 100vw;
    height: auto;
    flex-direction: column;
    margin-bottom: 60px;
  }

  .title-section, .description-section { width: 100%; height: auto; }
  .scroll-indicator { display: none; }

  .description-section { padding: 0; flex-direction: column; gap: 0; }
  .desc-box { flex: 1 1 100%; }

  .desc-box::after { bottom: calc(50% - 18.5px); }
  .desc-box p { display: inline-block; width: 90%; }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px;
    z-index: 1002;
    background: #222;
    height:60px;
  }

  .menu-btn, .contact-btn { height: 40px; flex-direction: column; justify-content: flex-end; }
  .menu-btn .material-symbols-outlined { font-size: 32px; margin-bottom: 6px; }
  .contact-btn .material-symbols-outlined { font-size: 28px; }
  .menu-btn p, .contact-btn p { font-size: 10px; }

  .menu-panel { width: 100vw; right: -100vw; }
  .menu-panel.active { right: 0; height: calc(100vh - 60px); }
  .menu-panel li { font-size:20px; }

  /* ← A: 末尾ボタン群にも少し余白（保険） */
  .btn-box, .btn-box-d { margin-bottom: 16px; }
}

/* ================= lower ================= */
.sub-main { width: 95vw; background: #f5f5f5; }

.sub-title-area { position: relative; width: 100%; }

.sub-title-bg {
  background: url('../images/bg_head_other-pc.jpg') center center / cover no-repeat;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-title-bg h1 {
    color: #47b459;
    font-size: 58px;
    font-weight: bold;
    mix-blend-mode: multiply;
}

.breadcrumb {
    background-color: #47b459;
    color: #fff;
    font-size: 14px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 3px;
    opacity:1;
    transition:.3s;
}
.breadcrumb a:hover{ opacity:.5; }

.sub-content {
  padding:40px 120px;
  font-size: 16px;
  line-height: 1.8;
  background: #f5f5f5;
}
.sub-content section { padding: 20px 15px; border-bottom: 1px solid #d1d1d1; }
.sub-content section:last-child { border: 0; }
.sub-content section h2 { margin-bottom: 5px; }
.sub-content a {
    color: #47b459;
    text-decoration: underline;
    font-weight: 500;
    transition: .3s;
}
.sub-content a:hover { opacity: .5; }

@media (max-width: 768px) {
  .sub-main { width:100%; margin-right: 0; margin-bottom: 60px; }
  .sub-title-bg { height: 180px; text-align: center; }
  .sub-title-bg h1 { font-size: 28px; }
  .breadcrumb { font-size: 12px; padding: 8px 15px; }
  .sub-content { padding: 20px 15px; margin-bottom: 60px; }
}

/* ================= purpose ================= */
.sub-content.purpose { display: flex; gap: 3%; }

.purpose-photo { text-align: center; }
.purpose-photo p { margin-top: 10px; line-height: 1.75em; }
.purpose-photo p span { font-weight: bold; font-size: 1.25em; }

.purpose-txt { width: 70%; }
.purpose-txt h2 { margin-bottom: 50px; }
.purpose-txt ul { margin: 30px 0; }
.purpose-txt li { color: #222; font-weight: bold; line-height: 2em; }
.purpose-txt p.name { text-align: right; margin-top: 15px; font-weight: 500; }

.greeting-container { display: flex; align-items: flex-start; gap: 24px; }

/* 画像ブロックを縦積み＋中央揃え */
.purpose-photo {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.purpose-photo img {
  width: 160px;
  height: auto;
  display: block;
  margin-bottom: 8px;
}
.purpose-photo p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .sub-content.purpose { flex-direction: column; }
  .purpose-photo { width: 100%; margin-bottom: 30px; }
  .purpose-photo img { max-height: 325px; }
  .purpose-txt { width: 100%; }
  .purpose-txt h2 { margin-bottom: 30px; }
  .purpose-txt ul { margin: 15px 0; }
  .purpose-txt li { line-height: 1.5em; margin-bottom: 7.5px; }

  .greeting-container { flex-direction: column; gap: 24px; }
}

/* ================= about ================= */
.sub-content.about ul { padding-left: 1.5em; }
.sub-content.about li{ list-style:disc; }

table {
  width: 70%;
  border-collapse: collapse;
  border: 2px solid #ccc;
}
th, td { border: 1px solid #ccc; padding: 12px 15px; }
th {
  font-weight: bold;
  text-align: center;
  background-color: #47b459;
  color: #fff;
}
td { text-align: left; }

.about-text { margin-bottom: 16px; }
section div.about-text:last-child { margin-bottom: 0; }

.qr-code { text-align: right; }
.qr-code img { max-width: 100px; height: auto; }

.donate-section { display: flex; align-items: center; gap: 20px; }
.text-content { flex-grow: 1; }
.qr-code img { width: 150px; height: auto; }

@media (max-width: 768px) {
  .sub-content.about li{font-size:14px;}
  table, thead, tbody, th, td, tr { display: block; }
  table { width: 100%; border: none; }
  tr { border: 1px solid #ccc; }
  th, td { border: none; padding: 6px 0px; }
  th { text-align: center; background-color: #47b459; color: #fff; }
  td { text-align: center; border-top: 1px solid #ddd; }
}

/* ================= tax（タブ） ================= */
/* 旧: flex＋absoluteを廃止してスマホ崩れを解消 */
.sub-content .tab-wrap{
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr)); /* PCで3列 */
  gap: 12px 14px;
}
.sub-content .tab-wrap a{
  display: flex;
  align-items: center;
  justify-content: space-between;     /* テキスト左／アイコン右 */
  gap: .5em;
  text-decoration: none;
  color: #fff;
  background: #47b459;
  padding: 10px 14px;                 /* タップしやすい標準パディング */
  border-radius: 999px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
/* 旧absolute指定の保険で無効化（他CSSが残っていても勝つ） */
.sub-content .tab-wrap a span{
  position: static !important;
  margin-left: 0;
  top: auto;
}
.sub-content .tab-wrap a .material-symbols-outlined{
  font-size: 1.25em;
  transition: transform .2s ease;
}
.sub-content .tab-wrap a:hover .material-symbols-outlined{
  transform: translateY(1px);
}

/* タブセクション周り */
.sub-content.tax section { padding: 50px 15px; }
.tax-box { margin-top: 2.5em; }
.tax-box .img-box { margin-bottom: 1em; }
.tax-box img { max-width: 600px; }

.sub-content.tax h3 { margin-bottom: 0.5em; }
.sub-content.tax h3 span { margin-right: 0.25em; }

.tax .formula {
  display: block;
  max-width: 900px;
  text-align: center;
  padding: 1.5em;
  background: #fff;
  border: 3px solid #47b459;
  border-radius: 5px;
  margin: 7.5px 0;
}
.tax ul { padding-left: 1em; }
.tax li { color: #47b459; }
.tax li.kome { list-style: '※'; }
.tax li.kome-d { list-style: '※※'; margin-left: 1em; }

span.add { color: #fff; background: #ef4a25; padding: 0 0.75em; }

.process {
  background: #fff;
  padding: 25px;
  border-radius: 5px;
  margin-top: 30px;
}
.process h4 {
  border-bottom: 2px solid #47b459;
  display: inline-block;
  margin-bottom: 10px;
}

@media (max-width: 1024px){
  .sub-content .tab-wrap{
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* 自動で2列程度に */
    gap: 12px;
  }
}
@media (max-width: 768px) {
  .tax-box img { width: 100%; }
  .tax .formula { width:100%; }
  .tax li{ font-size:14px; }

  /* スマホでは1列の全幅ボタンに */
  .sub-content .tab-wrap{ grid-template-columns: 1fr; gap: 10px; }
  .sub-content .tab-wrap a{ width: 100%; padding: 12px 16px; font-size: 14px; }
}

/* ================= apply ================= */
.apply-box { margin-bottom: 20px; }
.sub-content.apply h2 { margin-bottom: 30px; }
.apply-box h3 { margin-bottom: 10px; }
.apply-box li { list-style: disc; margin-left: 1.5em; }
.apply-box ul { margin-top: 7px; }
.apply-box ul.card { margin: 10px 0; }
.apply-box ul.card li { list-style: none; display: inline-block; margin: 0; margin-right: 5px; }

/* 末尾ボタン */
.btn-box { text-align: center; margin-top: 30px; }
.btn-box a {
    display: inline-block;
    text-decoration: none;
    background: #ef4a25;
    color: #fff;
    padding: 1em 2em;
    border-radius: 5px;
    /* ← C: 幅を安定化 */
    width: 100%;
    max-width: 400px;
    text-align: center;
    word-break: keep-all;
}

/* ← C: ダブルボタンを縦積みのflexに変更＋整列 */
.btn-box-d {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
    justify-items: center;
}
.btn-box-d a {
    text-decoration: none;
    background: #ef4a25;
    color: #fff;
    padding: 1em 2em;
    border-radius: 5px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    word-break: keep-all;
}

.apply li { color: #47b459; }
.apply li.kome { list-style: '※'; }
.apply li.kome-d { list-style: '※※'; margin-left: 1em; }

/* ================= ご挨拶レイアウト上書き ================= */
.greeting-container {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  align-items: start;
  column-gap: 32px;
  row-gap: 0;
  margin-bottom: 40px;
}
.purpose-photo { display: flex; flex-direction: column; align-items: center; text-align: center; }
.purpose-photo img {
  width: 100%;

  max-width: 320px;
  height: auto;
  display: block;
  border-radius: 8px;
}
.purpose-photo p { margin-top: 10px; font-size: 14px; line-height: 1.6; }
.greeting-container > p { margin: 0; font-size: 20px; line-height: 1.9; word-break: break-word; }
.greeting-container + .greeting-container { margin-top: 32px; }

@media (max-width: 1024px) {
  .greeting-container {
    grid-template-columns: minmax(220px, 260px) 1fr;
    column-gap: 24px;
  }
  .purpose-photo img { max-width: 260px; }
}
@media (max-width: 768px) {
  .greeting-container { display: flex; flex-direction: column; gap: 16px; }
  .purpose-photo { width: 100%; }
  .purpose-photo img { width: 70%; max-width: none; }
  .greeting-container > p { font-size: 15px; line-height: 1.85; }
}

.contact-btn img.icon {
  width: 30px;
  height: auto;
  vertical-align: middle;
  margin-bottom: 10px;
}
