* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /*
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  */
  font-family: "fot-udmarugo-large-pr6n", "FOT-UD丸ゴ_ラージ Pr6N", "M PLUS Rounded 1c", sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-header {
  /*
  position: fixed;
  */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5%;
  /*
  border-bottom: 1px solid #e5e5e5;
  */
}

.site-header h1 {
  margin: 0;
  font-size: 24px;
}

.site-header nav {
  display: flex;
  gap: 20px;
}

main {
  width: min(1000px, 90%);
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  padding: 64px 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


 /*TOPページmoreリンク*/

.more-link {
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}


 /*ニュース一覧全体*/

.news-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}


/* ニュース一覧1記事分 */
.news-item {
  border-top: 1px solid #e5e5e5;
}

.news-item:last-child {
  border-bottom: 1px solid #e5e5e5;
}

/* ニュースのカテゴリ・日付・タイトルの横並び */
.news-item a {
  display: grid;
  grid-template-columns: 120px 120px 1fr;
  gap: 16px;
  padding: 18px 0;
  text-decoration: none;
}

  /*カテゴリ*/
.news-category {
  display: inline-block;
  color: #555;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 日付 */
.news-date {
  color: #777;
  font-size: 14px;
}

 /* ニュースのタイトル */
.news-title {
  font-weight: 600;
}

/* ニュース詳細ページ全体 */
.news-detail {
  max-width: 760px;
}

.news-detail h1 {
  margin-top: 12px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.35;
}

 /* ニュース詳細本文全体 */
.news-body {
  margin-top: 40px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-body img {
  max-width: 100%;
  height: auto;
}

/* メイン画像 */
.news-main-image {
  margin: 24px 0;
}

.news-main-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* 本文内画像のfigure */
.news-body figure {
  margin: 24px 0;
}

.news-body figure img {
  display: block;
  /*
  width: 100%;
  */
  width: auto;
  height: auto;
}

/*詳細ページNews一覧へ戻る*/
.back-link-wrap {
  margin-top: 48px;
}


.site-footer {
  padding: 32px 5%;
  border-top: 1px solid #e5e5e5;
  color: #777;
}

.error-message {
  color: #c00;
}

@media (max-width: 640px) {
  .site-header {
    display: block;
  }

  .site-header nav {
    margin-top: 12px;
  }

  .news-item a {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* ========================================
   NEWS一覧ページ オリジナルレイアウト
   ======================================== */

   /* 1. ページ全体(body)に星空の背景を敷く（iOSバグ完全回避の魔法版！） */
   body {
     /* body本体にはベースの背景色だけを指定する */
     background-color: var(--color-secondary); 
   }
   
   /* 画面に固定された透明な「巨大な下敷き（疑似要素）」を作って、そこに背景画像を貼る */
   body::before {
     content: "";
     position: fixed; /* 背景画像を画面にピタッと固定 */
     top: 0;
     left: 0;
     width: 100vw;
     height: 100vh; /* 画面ぴったりの高さに指定（これが巨大化を防ぐ鍵！） */
     z-index: -100; /* 全ての要素の一番奥に敷き詰める */
     
     /* 画像の読み込みとサイズ指定 */
     background-image: url(../images/sec02_bg.webp); 
     background-image: image-set(url(../images/sec02_bg.webp) 1x, url(../images/2x/sec02_bg@2x.webp) 2x);
     background-image: -webkit-image-set(url(../images/sec02_bg.webp) 1x, url(../images/2x/sec02_bg@2x.webp) 2x);
     background-repeat: no-repeat;
     background-size: cover;
     background-position: center;
   }


main {
  width: min(1000px, 96%);
  margin: 0 auto;
  padding: 48px 0;
}

/* ========================================
   ヘッダーの固定とロゴサイズ調整
   ======================================== */
.site-header {
  /* fixedを確実に効かせるための指定を追加 */
  top: 40px;
  left: 0;
  width: 100%;
  z-index: 900; 
  
  /* 上下の余白を少しスッキリさせる */
  padding: 15px 3%;
  color: #fff;
}

/* ロゴをもっと小さくする */
.site-header h1 {
  width: clamp(100px, 15vw, 150px);
}

.site-header h1 img {
  display: block;
  width: 100%;
  height: auto;
}

/* テキストリンク（右側）のスタイル */
.site-header nav {
  font-weight: bold;
}
.site-header nav a:hover {
  opacity: 0.7; /* マウスオーバーで少し透けるように */
}



/* ========================================
   メインコンテンツの開始位置（押し下げ）
   ======================================== */
main {
  /* ★ポイント：fixedされたヘッダーの高さ分、上から押し下げる！ */
  padding-top: clamp(40px, 9vw, 100px) !important; 
}



/* 2. index.css で .news-section に付いている背景や余計な指定をリセット */
.news-section {
  background-image: none !important;
  background-color: transparent !important;
  /* index.cssの上下padding(80px)が不要な場合は上書き */
  padding: 0 !important; 
  margin-bottom: 80px;
}

/* ========================================
   NEWS一覧ページの白枠（.news-inner）の高さリセット
   ======================================== */
.news-inner {
  /* TOPページ固定の242pxを解除し、記事量に合わせて自動で伸ばす */
  height: auto !important; 
  margin-bottom: 50px;
  padding-bottom: 40px; 
}


.news-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.news-item {
  border-bottom: 1px solid #0096ff;
}

.news-item:last-child {
  border-bottom: 1px solid #0096ff;
}

.news-item a {
  display: grid;
  grid-template-columns: 170px 120px 1fr;
  gap: 16px;
  padding: 15px 0;
  text-decoration: none;
  align-items: center;
}

.news-item a:hover {
    opacity: 0.7;
}

.news-category {
  display: inline-block;
  color: #fff;
  font-size: 1.0rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background-color: var(--color-secondary);
  padding: 3px 10px;
  justify-self: start;
}

.news-date {
  display: inline-flex; /* ★追加：アイコンと文字を横並びにする */
  align-items: center;  /* ★追加：縦の中央をピタッと揃える */
  gap: 10px;
  color: #0096ff;
  font-size: 1rem;
  font-weight: bold;
  padding: 3px 10px;
}
.news-date::before {
    content: "";
    display: block;
    flex-shrink: 0; /* アイコンが潰れるのを防ぐ */
    
    width: 16px; 
    height: 14px; 
    
    /* アイコン画像の読み込み */
    background-image: url(../images/sec02_iconribbon.webp);
    background-image: image-set(url(../images/sec02_iconribbon.webp) 1x, url(../images/2x/sec02_iconribbon@2x.webp) 2x);
    background-image: -webkit-image-set(url(../images/sec02_iconribbon.webp) 1x, url(../images/2x/sec02_iconribbon@2x.webp) 2x);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

.news-title {
  color: #3c4346;
  font-weight: 600;
  padding: 3px 10px 3px 20px;
}

.news-detail {
  max-width: 1000px;
}

.news-detail h1 {
  margin-top: 12px;
  font-size: clamp(20px, 5vw, 36px);
  line-height: 1.35;
}

.news-body {
  margin-top: 40px;
}

.news-body img {
  max-width: 100%;
  height: auto;
}




@media (max-width: 768px) {

    /* ========================================
       NEWS - SP用
       ======================================== */
    
    .news-inner {
        width: 95%;
        height: auto;
        margin: 0 auto;
        padding: 2vw 3vw;
        background-color: #ffffff;
        
        /* 2. 方眼紙の薄いライン（縦線と横線） */
        background-image: 
            linear-gradient(90deg, rgba(0, 160, 233, 0.09) 1px, transparent 1px),
            linear-gradient(rgba(0, 160, 233, 0.09) 1px, transparent 1px);
        
        /* 3. 方眼のマス目のサイズ */
        background-size: 24px 24px;
        
        /* 4. 角丸（radius） */
        border-radius: 20px;
        
        border: 2px solid #00a0e9; /* 外枠が必要な場合 */
        
        background-position: top left;

    }

    .news__title-img {
        width: 95%;
        margin-top: 5%;
        margin-bottom: 8%;
    }

    
    .news-list {
      list-style: none;
      padding: 0;
      margin: 5px 0 0;
    }
    
    .news-item {
      border-top: 1px solid #e5e5e5;
    }
    
    .news-item:last-child {
      border-bottom: 1px solid #e5e5e5;
    }
    
    .news-item a {
        display: flex;
        flex-wrap: wrap;   
        align-items: center; 
        gap: 5px 12px;      
        padding: 10px 7px; 
    }
    
    .news-category {
        font-size: clamp(13px, 3vw, 16px);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        padding: 1% 2%;
        justify-self: start;
    }
    .news-date {
      color: #00a0e9;
      font-size: clamp(12px, 3vw, 16px);
      display: inline-flex;
        align-items: center;
        gap: 7px;
        margin-left: auto;
    }
    .news-date,
    .news-category {
        flex-shrink: 0;   
    }

    .news-date::before {
        width: 13px;
        height: 11px;
    }
    
    
    .news-title {
        width: 100%;       
        font-size: clamp(13px, 3vw, 16px);
        line-height: 1.4;
        padding-left: 5px;
        
        /* ========================================
           ★追加：長いタイトルを枠内で確実に複数行にする設定
           ======================================== */
        white-space: normal;       /* 万が一他で1行固定（nowrap）がかかっていても強制解除 */
        overflow-wrap: anywhere;   /* 英語の羅列やURL、記号でも絶対に枠を突き破らせず改行する */
        word-break: break-word;
    }

  }




  /* ========================================
  NEWS詳細ページ オリジナルレイアウト
  ======================================== */

/* 1. 記事全体を包む白枠（方眼紙） */
.news-detail {
 /* 上部で max-width: 760px; が指定済みなので、画面中央に寄せる */
 margin: 0 auto;
 
 /* TOPや一覧と同じ方眼紙デザインを適用 */
 background-color: #ffffff;
 background-image: 
   linear-gradient(90deg, rgba(0, 160, 233, 0.09) 1px, transparent 1px),
   linear-gradient(rgba(0, 160, 233, 0.09) 1px, transparent 1px);
 background-size: 24px 24px;
 border-radius: 20px;
 border: 2px solid #00a0e9;
 background-position: top left;
 
 padding: clamp(30px, 5vw, 60px) clamp(20px, 4vw, 50px);
 
 color: #333333;
 
 font-family: "fot-udmarugo-large-pr6n", "FOT-UD丸ゴ_ラージ Pr6N", "M PLUS Rounded 1c", sans-serif;
}

/* 2. 日付とカテゴリの並びを整える */
.news-detail .news-meta {
  display: flex;
  justify-content: space-between; 
  align-items: center;           
  flex-wrap: wrap;              
  gap: 10px;                    
}

.news-detail .news-category {
  display: inline-flex;
  align-items: center;
  background-color: var(--color-secondary);
  color: #ffffff;
  padding: 4px 14px;
  font-size: 14px;
  font-weight: bold;
}

.news-detail .news-date {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* リボンアイコンと日付テキストの隙間 */
  color: #00a0e9; /* 水色 */
  font-weight: bold;
}

/* ★追加：日付の前にリボンアイコンを表示する */
.news-detail .news-date::before {
  content: "";
  display: block;
  flex-shrink: 0;
  width: 16px; 
  height: 14px; 
  
  /* リボン画像のパス（一覧ページと同じものを流用） */
  background-image: url(../images/sec02_iconribbon.webp);
  background-image: image-set(url(../images/sec02_iconribbon.webp) 1x, url(../images/2x/sec02_iconribbon@2x.webp) 2x);
  background-image: -webkit-image-set(url(../images/sec02_iconribbon.webp) 1x, url(../images/2x/sec02_iconribbon@2x.webp) 2x);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* 3. タイトルの下に区切り線を引いてスッキリさせる */
.news-detail h1 {
 border-bottom: 3px dotted #0096ff;
 padding-top: 5px;
 padding-bottom: 10px;
 margin-bottom: 30px;
 color: #333;
}




.back-link-wrap {
  text-align: center;
  margin-top: 50px;
}
.back-link-wrap2 {
  text-align: center;
  margin-top: 30px;
}

/* ボタン本体のスタイル（共通） */
.back-link-wrap a,
.back-link-wrap2 a {
  /* ★ここがポイント：親の中央揃えを効かせるため inline-flex を使用 */
  display: inline-flex; 
  justify-content: center;
  align-items: center;
  
  width: clamp(200px, 20vw, 258px);
  padding-top: clamp(12px, 1.5vw, 16px);
  padding-bottom: clamp(12px, 1.5vw, 16px);
  padding-left: 24px;
  padding-right: 0;
  
  background-color: #00b3fb; 
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 100px;
  text-decoration: none;
  
  /* アニメーション設定 */
  transition: filter 0.2s, transform 0.3s ease, background-color 0.2s, color 0.2s;
}

/* ホバー時の挙動（右に6px動く ＋ 白背景×青文字） */
.back-link-wrap a:hover,
.back-link-wrap2 a:hover {
  filter: brightness(1.1);
  transform: translateX(6px);
  background-color: #ffffff;
  color: #00a0e9;
}

/* 白い右矢印アイコン */
.back-link-wrap a::after,
.back-link-wrap2 a::after {
  content: "";
  display: block;
  width: 20px;
  height: 16px;
  margin-left: 12px; 
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M4 11h12.172l-5.364-5.364 1.414-1.414L21.414 12l-9.192 9.192-1.414-1.414L16.172 13H4v-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(1px);
}

/* ★ホバー時に矢印の色も「青（#00a0e9）」に変化させる */
.back-link-wrap a:hover::after,
.back-link-wrap2 a:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300a0e9'%3E%3Cpath d='M4 11h12.172l-5.364-5.364 1.414-1.414L21.414 12l-9.192 9.192-1.414-1.414L16.172 13H4v-2z'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
  .back-link-wrap a,
  .back-link-wrap2 a {
      width: 80%;
      max-width: 280px; /* NEWSの文字数に合わせて、他のボタンより少しだけ最大幅を広げています */
  }
}





/* ========================================
   スマホ時のヘッダー表示崩れ修正
   ======================================== */
@media (max-width: 640px) {
  .site-header {
    /* style.css上部にある display: block; を上書きして横並びを維持する！ */
    display: flex !important;
  }
  
  .site-header nav {
    /* スマホでリンクが下に落ちるのを防ぐため上書き */
    margin-top: 0 !important; 
    gap: 15px; /* 隙間を少し狭める */
    font-size: 14px;
  }
  
}





/* ========================================
   コンテンツが短い時にフッターを画面最下部に落とす
   ======================================== */
body {
  /* ページ全体を縦並びのフレックスボックスにする */
  display: flex;
  flex-direction: column;
  /* 最低でも画面の高さ（100vh）を確保する */
  min-height: 100vh;
}

main {
  flex: 1;
}

/* ========================================
   フッターの下余白リセット（下層ページはCTAがないため）
   ======================================== */
.footer {
    padding-bottom: 30px;
}

/* スマホ版（768px以下）の調整 */
@media (max-width: 768px) {
    .footer {
        padding-bottom: calc(0px + env(safe-area-inset-bottom));
    }



 
}





