@charset "UTF-8";

/* ----------------------------------------------  Color Palette (和風・吉祥テーマ) ---------------------------------------------- */
:root {
  --main-color: #7b0010;   /* 深紅（こきあけ）- 重厚な赤 */
  --accent-color: #c49a31; /* 黄金（こがね）- 華やかな金 */
  --text-color: #2b2b2b;   /* 墨色 */
  --bright-color: #fdfaf1; /* 練色（ねりいろ）- 柔らかな白 */
}
/* ----------------------------------------------  reset ---------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; vertical-align: bottom; }
html { font-size: 62.5%; scroll-behavior: smooth; /* スムーズスクロール */ }

/* ----------------------------------------------  body ---------------------------------------------- */
body {
  background-color: var(--bright-color);
  color: var(--text-color);
  font-size: 1.6rem;
  /* 和風フォント指定 */
  font-family: 'Noto Serif JP', "Yu Mincho", "Hiragino Mincho ProN", serif;
  line-height: 1.0;
}

/* ----------------------------------------------  layout ---------------------------------------------- */
.container {
  width: min(90%, 1080px); /* コンテンツ幅を少し狭めて上品に */
  margin: 0 auto;
}

/* ----------------------------------------------  header ---------------------------------------------- */
.header {
  /* 背景画像はコラージュした和柄テクスチャを指定する前提 */
  background: linear-gradient(rgba(43, 58, 85, 0.7), rgba(43, 58, 85, 0.7)), url(../img/bg.png) no-repeat center center / cover;
  width: 100%;
  height: 100vh;
  position: relative;

  > .container {
    display: flex;
    flex-direction: row-reverse;
    height: 100%;
    padding-bottom: 100px; /* CTAボタンとの被りを防ぐ */
    align-items: flex-start;
  }
}

h1 {
  margin-top: 10vh;
  margin-left: 50px;
  padding: 40px 20px;
  /* 背景色ではなく、文字色と枠線で表現 */
  color: var(--accent-color);
  border-top: 3px solid var(--accent-color);
  border-bottom: 3px solid var(--accent-color);
  font-size: 5.6rem;
  writing-mode: vertical-rl;
  letter-spacing: 1.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);

  @media screen and (max-width: 767px) {
    font-size: 4.0rem;
    margin-left: 20px;
    letter-spacing: 1rem;
  }
}

.lead {
  margin: 15vh 0 0 40px;
  height: fit-content;
  writing-mode: vertical-rl;

  > p {
    margin-left: 20px;
    color: #fff; /* 背景が暗いので白文字 */
    font-size: 2.8rem;
    font-weight: normal;
    letter-spacing: 0.4rem;
    line-height: 2.0;

    @media screen and (max-width: 767px) {
      font-size: 2.0rem;
      margin-left: 16px;
    }
  }
}

/* ------------- logo image ------------- */
.logo {
  > img {
    width: 80px;
    margin-top: 40px;
    position: absolute;
    top: 20px;
    left: 20px;
    /* ロゴの色を金色系に変更するフィルター（SVGの色が黒の場合） */
    filter: invert(74%) sepia(58%) saturate(467%) hue-rotate(3deg) brightness(94%) contrast(91%);
  }
}

/* -------- CTA (Call to Action) -------- */
.more_btn {
  position: absolute;
  left: 50%;
  bottom: 50px;
  transform: translateX(-50%);
  text-align: center;

  > a {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--accent-color); /* 金色系 */
    color: var(--main-color); /* 濃藍色 */
    font-size: 1.8rem;
    letter-spacing: 0.2rem;
    font-weight: bold;
    border-radius: 2px;
    transition: opacity 0.3s;
    
    &:hover {
      opacity: 0.8;
    }
  }
}

/* ----------------------------------------------  nav ---------------------------------------------- */
.gnav {
  margin: 15vh 0 0 auto;
  writing-mode: vertical-rl;

  li {
    font-size: 2.0rem;
    font-weight: bold;
    position: relative;
    margin-left: 30px;
  }

  a {
    display: block;
    padding: 20px 10px;
    color: #fff;
    font-size: 30px;
    position: relative;
    transition: color 0.3s;

    &::before {
        content: "";
        padding: 16px;
        position: absolute;
        top: -15px;
        left: 20%;
        background: url(../img/icon.png) no-repeat center center / contain;
      }

    /* ホバー時に金色になるアンダーライン（縦書きなので右線） */
    &::after {
      content: '';
      position: absolute;
      top: 0;
      right: -10px;
      width: 2px;
      height: 0;
      background-color: var(--accent-color);
      transition: height 0.3s;
    }

    &:hover {
      color: var(--accent-color);
      &::after {
        height: 100%;
      }
    }
  }
  @media screen and (max-width: 767px) {
    display: none; /* スマホでは一旦非表示（実案件ではハンバーガーメニュー等にする） */
  }
}


/* ==============================================
   Main Content (Pattern Sections)
============================================== */
main {
  padding: 120px 0;
  background-color: var(--bright-color);
  /* 和紙のようなテクスチャを薄くかけるとさらに良い */
  background-image: url(../img/washi_texture_subtle.png); 
}

.pattern-section {
  margin-bottom: 150px; /* セクション間の余白 */
  
  &:last-child {
    margin-bottom: 0;
  }
}

.section-header {
  writing-mode: vertical-rl;
  margin-left: auto; /* 右寄せ */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-bottom: 40px;
}

h2 {
  font-size: 3.6rem;
  color: var(--main-color);
  letter-spacing: 0.5rem;
  position: relative;
  padding-bottom: 20px; /* 縦書きなので下方向への余白 */

  /* アクセントの飾り線 */
  &::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: var(--accent-color);

  @media screen and (max-width: 900px) {
    width: 250px;
    height: 4px;
}
  }
}
.difficulty {
  display: block;
  margin-top: 20px; /* 縦書きなので左方向への余白になる */
  margin-right: 20px;
  font-size: 2.0rem;
  color: var(--accent-color);
  font-weight: bold;
}

/* コンテンツエリア（画像とテキスト） */
.pattern-content {
  display: flex;
  flex-direction: row-reverse; /* 右にテキスト、左に画像 */
  justify-content: space-between;
  height: 380px; /* 高さを固定して縦書きを綺麗に見せる */
}

/* 偶数番目のセクションは配置を逆にする */
.container.reverse-layout .pattern-content {
  flex-direction: row; /* 左にテキスト、右に画像 */
}

.pattern-text {
  writing-mode: vertical-rl;
  font-size: 1.9rem;
  line-height: 2.2;
  height: 100%;
  flex-basis: 45%; /* 幅の配分 */

  p {
    margin-left: 30px; /* 段落間の余白 */
  }
}

.pattern-image {
  flex-basis: 50%;
  height: 100%;
  position: relative;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠に合わせてトリミング */
    border-radius: 4px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.15);
    /* 画像に少し和紙の質感を乗せるフィルター効果（任意） */
    /* mix-blend-mode: multiply; */ 
  }
    /* 画像周りの装飾フレーム（任意） */
    &::after {
        content: '';
        position: absolute;
        top: 15px;
        left: 15px;
        width: 100%;
        height: 100%;
        border: 2px solid var(--accent-color);
        z-index: -1;
    }
    
  /* 逆配置の時の装飾フレーム位置調整 */
  .reverse-layout &::after {
      top: 15px;
      left: -15px;
  }
}

/* -------- Responsive (Tablet & Mobile) -------- */
@media screen and (max-width: 900px) {
  .container { width: 94%; }
  
  .pattern-content,
  .container.reverse-layout .pattern-content {
    flex-direction: column-reverse; /* 画像が上、テキストが下 */
    height: auto; /* 高さは成り行き */
    align-items: center;
  }

  .section-header {
    writing-mode: horizontal-tb; /* 見出しを横書きに戻す */
    align-items: center;
    margin-left: 0;
    margin-bottom: 30px;
    text-align: center;
  }
  
  h2 {
      padding-bottom: 0;
      margin-bottom: 10px;
      &::before {
          top: auto;
          bottom: -10px;
      }
  }

  .difficulty {
      margin-top: 15px;
  }

  .pattern-text {
    writing-mode: horizontal-tb; /* テキストも横書きに戻す */
    width: 100%;
    margin-top: 40px;
    
    p {
      margin-left: 0;
      margin-bottom: 20px;
    }
  }

  .pattern-image {
    width: 100%;
    height: 300px; /* スマホでの画像の高さ */
    
     /* スマホでは装飾フレームを非表示にするか調整 */
     &::after { display: none; }
  }
}