/*
Theme Name: ryoshi-complete
Author: Ryoshi
Version: 1.2
*/

/* ================================
   共通変数
================================ */
:root {
  --color-text: #333;
  --color-heading: #222;
  --color-border: #ddd;
  --color-accent: #2563eb;
  --color-link-hover: #0073aa;
  --color-deep-blue: #103a7a;
  --color-tint-blue: #eef4fc;
  --header-height: 120px;
}
body, input, textarea, button, select {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}
/* ================================
   サイト全体の幅を統一
================================ */
body {
  overflow-x: hidden;
}

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
}

/* ------------------------------
   基本レイアウト（ナビ）
   ヘッダーは常に画面上部に固定表示。
   トップページのみ最初は透明でヒーロー画像に重ね、
   スクロールすると白背景に切り替わる（menu.js が is-scrolled を付与）。
------------------------------ */
header {
  position: fixed; /* static や relative から『fixed』に戻す */
  top: 0;          /* 復活させる */
  left: 0;         /* 復活させる */
  width: 100%;     /* 復活させる */
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
/* 【ここをアップデート】PC画面のときの設定 */
/* PC画面（横幅769px以上）のときの設定 */
@media (min-width: 769px) {
  header {
    /* スクロールで上に消えるように absolute に変更（背景画像エリアを下に押し下げない） */
    position: absolute !important; 
    top: 0 !important;          
    left: 0 !important;         
    width: 100% !important;
    z-index: 9999 !important; 
    
    /* ヘッダーの背景を透明にして、後ろにある背景画像が見えるようにする */
    background: transparent !important; 

    border-bottom: 1px solid var(--color-border);
    display: block !important;
    height: auto !important;
  }

  header a, 
  header p, 
  header h1 {
    color: #333333 !important; /* メニューの文字色は黒で見えるようにする */
  }

  main {
    margin-top: 0 !important;
    top: 0 !important;
    transform: none !important;
  }
  
  /* 【修正】元々うまくいっていた -230px の引き上げ位置をPCでも正確に維持します */
  .hero-copy {
    transform: translateY(-230px) !important; 
  }
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

header h1 {
  font-size: 20px;
  margin: 0 0 2px;
  line-height: 1.3;
}

header p {
  font-size: 13px;
  margin: 0 0 8px;
  opacity: 0.8;
}

/* トップページ：ヒーロー画像の上に重なっている間は透明＆白文字 */
body.home header,
body.front-page header {
  background: transparent;
  border-bottom-color: transparent;
}

body.home header h1,
body.home header p,
body.home nav a,
body.home .menu-toggle,
body.front-page header h1,
body.front-page header p,
body.front-page nav a,
body.front-page .menu-toggle {
  color: #ffffff;
}

/* PCのドロップダウンは常に白背景なので、文字色は通常色に戻す */
body.home nav ul li ul a,
body.front-page nav ul li ul a {
  color: var(--color-text);
}

/* スクロールしてヒーローを抜けたら白背景に戻す（menu.js が付与） */
body.home header.is-scrolled,
body.front-page header.is-scrolled {
  background: #ffffff;
  border-bottom-color: var(--color-border);
}

body.home header.is-scrolled h1,
body.home header.is-scrolled p,
body.home header.is-scrolled nav a,
body.home header.is-scrolled .menu-toggle,
body.front-page header.is-scrolled h1,
body.front-page header.is-scrolled p,
body.front-page header.is-scrolled nav a,
body.front-page header.is-scrolled .menu-toggle {
  color: var(--color-text);
}

/* ヘッダーが固定されている分、本文側に上余白を確保
   （トップページはヒーローが最上部から始まるので不要） */
main {
  padding-top: var(--header-height);
}

body.home main,
body.front-page main {
  padding-top: 0;
}

nav { 
  background: transparent;
  font-family: system-ui, sans-serif;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 24px;
	justify-content: center; /* 【追加】横方向の中央揃えにする */
  flex-wrap: wrap;         /* 【追加】画面幅が狭いときに自動で折り返す（崩れ防止） */
}

nav ul li {
  position: relative;
  display: flex;
  align-items: center;
}

nav a {
  display: block;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 16px;
}

nav a:hover {
  color: var(--color-link-hover);
}

/* ------------------------------
   ドロップダウン（PC）
------------------------------ */
nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 8px 0;
  min-width: 180px;
  z-index: 999;
}

nav ul li:hover > ul,
nav ul li.submenu-open > ul {
  display: block;
}

nav ul li ul li a {
  padding: 10px 12px;
  font-size: 15px;
}

.submenu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text);
  padding: 4px 10px;
  line-height: 1;
}

.submenu-toggle:hover {
  color: var(--color-link-hover);
}

.menu-item-has-children.submenu-open > .submenu-toggle {
  transform: rotate(180deg);
}

/* ------------------------------
   スマホ用ハンバーガー
------------------------------ */
.menu-toggle {
  display: none;
  cursor: pointer;
  padding: 12px;
  font-size: 20px;
  background: none;
  border: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
  }

  nav.open > ul {
    display: flex;
  }

  /* トップページで開いた時は、下に何があっても読めるよう濃い青の背景を敷く */
  body.home nav.open,
  body.front-page nav.open {
    background: rgba(16, 58, 122, 0.97);
  }

  body.home nav.open a,
  body.home nav.open .submenu-toggle,
  body.front-page nav.open a,
  body.front-page nav.open .submenu-toggle {
    color: #ffffff;
  }

  nav ul li {
    flex-direction: column;
    align-items: stretch;
  }

  nav ul li a {
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.0;
  }

  nav ul li ul {
    position: static;
    border: none;
    padding-left: 16px;
    width: 100%;
    background: transparent;
  }

  nav ul li ul li a {
    padding-left: 16px;
  }

  .submenu-toggle {
    padding: 8px 16px;
    font-size: 14px;
    align-self: stretch;
    text-align: left;
  }

  nav.open > ul {
    padding: 0;
    margin: 0;
  }

  header {
    padding: 0;
  }
}

/* ================================
   ヒーロー（トップページのみ）
   青空 + 雲アニメーション
================================ */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #4f9be8;
}

.hero-sky img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: center;
  animation: sky-drift 50s ease-in-out infinite alternate;
}

@keyframes sky-drift {
  from { transform: scale(1.08) translate(-1.5%, 0%); }
  to   { transform: scale(1.15) translate(1.5%, -1%); }
}

/* 幅の狭いスマホでは左右移動をやめ、ズームだけにして端のはみ出しを防ぐ */
@media (max-width: 480px) {
  .hero-sky img {
    animation: sky-drift-mobile 50s ease-in-out infinite alternate;
  }

  @keyframes sky-drift-mobile {
    from { transform: scale(1.12); }
    to   { transform: scale(1.22); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-sky img {
    animation: none;
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #000;
  padding: 0 24px;
	
 transform: translateY(-230px);  
}

.hero-title {
  font-size: 60px;
  line-height: 1.6;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
	
}

.hero-sub {
  margin-top: -50px;
  font-size: 20px;
  line-height: 1.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
/* タブレット・スマホ用の設定（画面幅が1024px以下のとき） */
@media (max-width: 1024px) {
  .hero-copy {
    transform: translateY(-50px); /* 移動量を減らしてはみ出しを防ぐ */
    /* もしくは transform: none; で移動を無くす */
  }
	.hero-sub {
  margin-top: 0px;
  font-size: 20px;
  line-height: 1.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
}
.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-decoration: none;
  writing-mode: vertical-rl;
}
.hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 40px;
  background: #fff;
  margin: 8px auto 0;
  animation: scrollLine 1.6s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.3); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 768px) {
  .hero { height: 56vh; min-height: 320px; }
  .hero-title { font-size: 22px; }
  .hero-sub { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll::after { animation: none; }
}

/* ================================
   薄い青背景のセクション区切り
================================ */
.section-tinted {
  background: var(--color-tint-blue);
  padding: 8px 0 24px;
}

/* ================================
   ページ本文（固定ページ・記事詳細 共通）
================================ */

.page-content,
.join-guide,
.privacy-policy {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
  background: #fff;
  line-height: 1.8;
  font-size: 16px;
  color: var(--color-text);
}

.page-content h1,
.join-guide h1,
.privacy-policy h1 {
  font-size: 28px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 700;
}

.page-content h2,
.join-guide h2,
.privacy-policy h2 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 4px solid var(--color-accent);
  font-weight: 600;
}

.page-content h3,
.join-guide h3 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 10px;
  font-weight: 600;
}

.page-content p,
.join-guide p,
.privacy-policy p {
  margin-bottom: 16px;
}

.page-content ul,
.join-guide ul,
.privacy-policy ul {
  margin: 12px 0 20px 20px;
}

.page-content ul li,
.join-guide ul li,
.privacy-policy ul li {
  margin-bottom: 8px;
}

.page-content hr,
.join-guide hr,
.privacy-policy hr {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

.page-content strong,
.join-guide strong {
  font-weight: 700;
  color: var(--color-heading);
}

.privacy-policy strong {
  font-weight: 700;
}

.content-heading {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 0;
}

.content-heading h2 {
  font-size: 24px;
  padding-left: 8px;
  border-left: 4px solid var(--color-accent);
  font-weight: 700;
  margin: 0;
}

/* ================================
   記事一覧（最新ニュースなど・サムネイル付き）
================================ */
.entry-list {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 0 24px 24px;
  list-style: none;
}

.entry-list-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.entry-list-item:last-child {
  border-bottom: none;
}

.entry-thumb {
  flex: none;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f4f4;
}

.entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.entry-list-item a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 16px;
}

.entry-list-item a:hover {
  color: var(--color-link-hover);
}

/* ================================
   ファイル一覧（PDFアーカイブなど）
================================ */
.file-list {
  max-width: 900px;
  margin: 20px auto 40px;
  padding: 0 24px;
  list-style: none;
}

.file-list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.file-list-item:last-child {
  border-bottom: none;
}

.file-list-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  text-decoration: none;
}

.file-list-item a::before {
  content: "\1F4C4";
  font-size: 14px;
}

.file-list-item a:hover {
  color: var(--color-link-hover);
}

/* ================================
   フッター（青背景）
================================ */
footer {
  background: var(--color-deep-blue);
  color: #eaf1fc;
  padding: 40px 24px 24px;
  margin-top: 40px;
}

footer nav ul {
  justify-content: center;
  flex-wrap: wrap;
  background: transparent;
}

footer nav {
  background: transparent;
  border-bottom: none;
}

footer a {
  color: #cfe0fa;
}

footer a:hover {
  color: #ffffff;
}

footer small {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: #a9c4ee;
  font-size: 13px;
}

/* ================================
   スマホ対応（レスポンシブ・統合）
================================ */

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .header-inner {
    padding: 8px 16px 0;
  }

  header h1 {
    font-size: 16px;
  }

  header p {
    display: none;
  }

  .page-content,
  .join-guide,
  .privacy-policy,
  .content-heading,
  .entry-list,
  .file-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-content,
  .join-guide,
  .privacy-policy {
    padding-top: 16px;
    padding-bottom: 16px;
    font-size: 15px;
  }

  .page-content h1,
  .join-guide h1,
  .privacy-policy h1 {
    font-size: 24px;
  }

  .page-content h2,
  .join-guide h2,
  .privacy-policy h2,
  .content-heading h2 {
    font-size: 20px;
    border-left-width: 3px;
  }

  .page-content h3,
  .join-guide h3 {
    font-size: 18px;
  }

  .entry-thumb {
    width: 60px;
    height: 60px;
  }
}

/* categoryアーカイブページ用CSS*/
/* 記事カード全体の調整 */
.post-item {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 画像とバッジを包むエリア（ここを基準にバッジを絶対配置する） */
.post-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 の黄金比率に固定 */
    overflow: hidden;
    background: #f0f0f0;
}

/* 画像を枠いっぱいに綺麗に収める */
.post-thumbnail-link img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像を切り抜いてフィットさせる */
    transition: transform 0.3s ease;
}
.post-thumbnail-link:hover img {
    transform: scale(1.05); /* ホバー時に少しズーム */
}

/* 画像がない場合の表示 */
.no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* バッジを左上に配置するコンテナ */
.post-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px; /* バッジ同士の隙間 */
    flex-wrap: wrap;
    z-index: 2;
}

/* 共通の角丸・白抜きデザイン */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    color: #ffffff; /* 文字は白抜き */
    border-radius: 4px; /* 角丸四角形 */
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* サブカテゴリーバッジの背景色（例：濃いグレー） */
.badge-cat {
    background-color: #333333; 
}

/* 区分用タグバッジの背景色（例：鮮やかな青やオレンジ） */
.badge-tag {
    background-color: #0073aa; 
}

/* タイトル周辺の余白調整 */
.post-content {
    padding: 15px;
}
.post-date {
    font-size: 12px;
    color: #888;
}
.post-title {
    margin: 5px 0 0;
    font-size: 16px;
    line-height: 1.4;
}
.post-title a {
    color: #333;
    text-decoration: none;
}
.post-title a:hover {
    text-decoration: underline;
}
/* カテゴリ子ページ一覧のno-image枠を非表示にする */
/* 1. 「No Image」の文字とリンクエリア自体を完全に非表示にする */
.post-thumbnail-link:has(.no-image) {
    display: none !important;
}

/* 2. 独自テーマが「余白（padding）」で作っている大きな空白の枠を完全にゼロにする */
.post-thumbnail-wrapper:has(.no-image) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important; /* ←ここで画像用の大きな余白枠を完全に消滅させます */
    margin: 0 0 15px 0 !important; /* アイコンの下に少しだけ適正な隙間を作ります */
}

/* 3. アイコン（バッジ）の「画像に重ねる設定」を解除し、その場に安全に残す */
.post-thumbnail-wrapper:has(.no-image) .post-badges {
    position: relative !important; /* 絶対配置を解除して枠が潰れても消えないようにします */
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: flex !important; /* バッジが複数ある場合も綺麗に横並びさせます */
    gap: 5px !important;
}

/* 親カテゴリにアイコンを追加 */
/* 親ページ一覧（画像がある投稿）にだけ、バッジ（アイコン）を強制生成する */
/* 親ページで隠れてしまっている本物のバッジエリアを、画像の上の正しい位置に強制表示する */
