@charset "utf-8";

body { margin:0; padding:0; overflow-x:hidden; overflow-y:scroll; background:#fff !important; background-image:none !important; }
img { border:0; }

/* Desktop */
#responsive-main { width:760px; margin:0 auto; }
#main-content { width:auto; }
#side-menu { width:222px; }
#responsive-header { width:760px; height:250px; margin:0 auto; overflow:hidden; }
#responsive-header > table { width:760px !important; height:250px !important; margin:0; }
#responsive-header-mobile { display:none; }

/* デスクトップではスマホ専用パーツを非表示 */
#mobile-menu-bar, #mobile-nav-drawer, #page-top-btn { display: none !important; }

/* リスト（新着情報）の基本構造 */
.news-list {
  list-style-type: disc;
  margin: 10px 0 10px 20px;
  padding: 0;
  font-size: 11pt;
}

.news-list li {
  margin-bottom: 16px;
  line-height: 1.6;
}

@media screen and (max-width:700px) {
  html, body { width:100% !important; min-width:0; margin:0 !important; padding:0 !important; background:#fff !important; background-image:none !important; overflow-x:hidden !important; }

  /* 1. スマホ用ハンバーガーメニュー・バー */
  #mobile-menu-bar {
    display: block !important;
    width: 100% !important;
    background: #2b5c3f;
    padding: 8px 12px;
    box-sizing: border-box;
    text-align: right;
  }
  #mobile-menu-toggle {
    background: #ffffff;
    color: #2b5c3f;
    border: none;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
  }

  /* ドロワーメニューの中身 */
  #mobile-nav-drawer {
    display: block !important;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: #f4f7f4;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: left 0.3s ease;
    box-sizing: border-box;
    overflow-y: auto;
  }
  #mobile-nav-drawer.open {
    left: 0;
  }
  .drawer-header {
    background: #2b5c3f;
    color: #fff;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
  }
  .drawer-header button {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
  }
  #mobile-nav-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  #mobile-nav-drawer li {
    border-bottom: 1px solid #ddd;
  }
  #mobile-nav-drawer a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
  }
  #mobile-nav-drawer a:active {
    background: #e2e8e2;
  }

  /* Mobile Header */
  #responsive-header { display:none !important; }
  #responsive-header-mobile {
    display:block !important;
    position:relative !important;
    width:100% !important;
    height:auto !important;
    margin:0 0 12px 0 !important;
    padding:0 !important;
    line-height:0 !important;
    overflow:hidden !important;
    max-width:none !important;
    box-sizing:border-box !important;
  }
  #responsive-header-mobile > img {
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
    object-fit:cover !important;
  }
  #responsive-header-mobile > a {
    position:absolute !important;
    top:6% !important;
    right:0 !important;
    width:9.87% !important;
    height:8% !important;
    display:block !important;
  }

  /* Main area */
  #responsive-main { display:block !important; width:100% !important; margin:0 !important; padding:0 !important; table-layout:auto !important; box-sizing:border-box !important; }
  #responsive-main > tbody, #responsive-main > tbody > tr { display:block !important; width:100% !important; box-sizing:border-box !important; }
  
  /* メインコンテンツの左右に均等な余白を設定 */
  #main-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 12px !important;
    margin: 0 !important;
  }
  #side-menu { display: none !important; }
  #main-content > br:first-child { display:none !important; }
  
  .spacer-img { display:none !important; }
  
  /* テーブル全般のレスポンシブ対応 */
  #main-content table {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  #main-content .content-inner-table {
    width: 100% !important;
    table-layout: fixed !important; /* 幅を固定して折り返しを強制有効化 */
  }

  #main-content .content-inner-table td,
  #main-content .content-inner-table th {
    display: table-cell !important;
    padding: 6px 4px !important;
    box-sizing: border-box !important;
    font-size: 12px !important;
  }

  /* 項目名（役職・氏名・代表・分類・年会費）の1行固定 */
  .news-header-bar,
  .col-role, .col-name, .col-class, .col-fee, .col-rep {
    white-space: nowrap !important;
    width: auto !important;
  }

  /* --- 3列テーブル（役職・氏名・所属） --- */
  .content-inner-table tr td:nth-child(1),
  .content-inner-table tr td:nth-child(2) {
    white-space: nowrap !important;
  }
  /* 3列目の「所属」は折り返しを許可 */
  .content-inner-table tr td:nth-child(3) {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    width: auto !important;
  }

  /* --- 2列テーブル（法人名・代表） --- */
  /* 1列目の「法人名」は折り返しを許可 */
  .col-corp-name,
  .content-inner-table tr td:first-child:not(:nth-last-child(3)) {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    width: auto !important;
  }
  /* 2列目の「代表」は1行固定 */
  .col-rep,
  .content-inner-table tr td:nth-child(2):last-child {
    white-space: nowrap !important;
    width: 80px !important; /* 代表者名の幅を確保 */
  }

  /* Headline banner & green header bar */
  .headline-img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin-bottom: 4px !important;
  }
  
  .news-header-bar {
    padding: 8px 6px !important;
    box-sizing: border-box !important;
  }

  .news-body-cell {
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    height: auto !important;
  }

  /* スマホでの新着情報リスト設定 */
  .news-list {
    margin: 10px 0 10px 18px !important;
    padding: 0 !important;
    font-size: 15px !important;
  }

  .news-list li {
    margin-bottom: 18px !important;
    line-height: 1.65 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* PDFリンクの識別 */
  .news-list a.pdf-link::after {
    content: " (PDF)";
    font-size: 12px;
    color: #c00;
    font-weight: bold;
    margin-left: 4px;
  }

  /* 画像のリサイズ */
  #main-content img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* リンクのタップ領域確保 */
  #main-content a {
    display: inline-block !important;
    padding: 3px 0 !important;
  }

  /* Footer */
  body > table:last-of-type { width:100% !important; height:auto !important; box-sizing:border-box !important; }
  body > table:last-of-type table { width:100% !important; box-sizing:border-box !important; }

  /* 追従型「ページトップへ戻る」ボタン */
  #page-top-btn {
    display: block !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(43, 92, 63, 0.9);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 9888;
  }
}

@media screen and (max-width:420px) { #main-content { font-size:16px; } }

@media screen and (max-width:700px) {
  #main-content > table {
    height: auto !important;
  }
  #main-content > table td[style*="height: 346px"] {
    height: auto !important;
  }
}

@media screen and (max-width:700px) {
  /* イベントテーブルの個別調整 */
  .content-inner-table.event-table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 !important;
    box-sizing: border-box !important;
    table-layout: fixed !important;
  }

  .content-inner-table.event-table td,
  .content-inner-table.event-table th {
    padding: 6px 3px !important;
    font-size: 11.5px !important;
    overflow: hidden !important;
  }

  .event-table tr td:nth-child(1),
  .event-table tr th:nth-child(1) {
    width: 28% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .event-table tr td:nth-child(2),
  .event-table tr th:nth-child(2) {
    width: 44% !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  .event-table tr td:nth-child(3),
  .event-table tr th:nth-child(3) {
    width: 28% !important;
    white-space: nowrap !important;
    text-align: center !important;
  }
}

@media screen and (max-width:700px) {
  /* 国歌テーブルをスマホで強制的に1列縦並びにする */
  .anthem-table,
  .anthem-table tbody,
  .anthem-table tr,
  .anthem-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
  .anthem-header-row,
  .anthem-border-col {
    display: none !important;
  }
  .anthem-section-row {
    margin-bottom: 15px !important;
    border-bottom: 1px dashed #67B539 !important;
    padding-bottom: 10px !important;
  }
  .anthem-es-cell {
    background-color: #eaf5e7 !important;
    padding: 8px !important;
    margin-top: 6px !important;
    border-radius: 4px !important;
  }
}