/*
メディアクエリを使用したレスポンシブデザイン
- PCファーストで設計しているので、部分的に@media (max-width: 500px)などで指定する
*/

/*reset.css*/
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
dl,
dt,
dd,
table,
th,
td,
form,
fieldset,
legend,
input,
textarea,
button,
select,
img,
svg,
figure,
figcaption,
blockquote,
iframe,
small {
  all: unset;
  box-sizing: border-box;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
dt {
  display: block;
}

h1,
h2,
h3,
.cute_font {
  font-family: "RocknRoll One", sans-serif;
}

h1,
h2 {
  color: #634529;
  font-size: 2.6em;
}

h1 span,
h2 span {
  color: #ff7f30;
  display: inline-block;
}

a {
  /*リンクがしっかり折り返す様に*/
  word-break: break-all;
  word-wrap: break-word;
  white-space: normal;
}

/*htmlにつけるといいCSS*/
html {
  scroll-behavior: smooth;
  scroll-padding: 100px;
  width: 100%;
  background-color: #e0cfba;
  background-image: url(../images/common/wall_paper.jpg);
  background-repeat: repeat;
}

/*PCの画面幅をSPの画面幅に合わせる*/
body > :is(div, nav, section, main, article, header, footer) {
  max-width: 500px;
  margin-inline: auto;

  @media (min-width: 1000px) {
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
  }
}

/*PC用のメインレイアウトコンテナ（古い定義のため削除）*/
/*@media (min-width: 1000px) {
  .layout_container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2em;
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
    box-sizing: border-box;
  }
  
  .main_content_wrapper {
    display: contents;
  }
  
  .site_global_header,
  .site_footer {
    grid-column: 1 / -1;
  }
  
  .main-visual-image {
    grid-column: 1 / -1;
  }
}*/

/* グリッドレイアウトの定義 */
.site_wrapper {
  display: grid;
  width: 100%;
  min-height: 100vh;
  gap: 40px;
  box-sizing: border-box;

  /* モバイルレイアウト */
  grid-template-areas:
    "header"
    "main_visual"
    "content"
    "footer";

  /* PCレイアウト */
  @media (min-width: 1000px) {
    grid-template-columns: 1fr 3fr; /* MENUとコンテンツの比率を1:2 */
    grid-template-rows: auto auto 1fr auto; /* ヘッダー、ナビゲーション・メインビジュアル、コンテンツ、フッター */
    grid-template-areas:
      "header header"
      "nav main_visual"
      "nav content"
      "footer footer";
  }
}

/* グリッドアイテムの配置 */
.grid_header {
  grid-area: header;
}

.grid_main_visual {
  grid-area: main_visual;
}

.site_nav {
  @media (min-width: 1000px) {
    grid-area: nav; /* PCではナビゲーションをnavエリアに配置 */
  }
}

.grid_main_content {
  grid-area: content;
}

.grid_footer {
  grid-area: footer;
}

/*ログインフォームと新規登録フォームのスタイル*/
.login form,
.register form {
  width: 100%; /* 横幅いっぱいに広げる */
  max-width: none; /* 最大幅の制限を解除 */
  padding: 3em 2em; /* 左右のパディングを調整 */
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0px 0px 15px -5px #777777;
  display: flex;
  flex-direction: column;
  gap: 2em;
  margin-inline: 0; /* 中央寄せを解除 */

  .center {
    display: flex;
    flex-direction: column;
    gap: 1em;
    align-items: center;
  }

  .input_box {
    display: flex;
    gap: 1em;
    flex-direction: column;
  }

  .form_item {
    label {
      display: block;
      font-size: 1.1em;
      font-weight: bold;
      margin-bottom: 0.25em;
    }

    input {
      width: 100%;
      height: 40px;
      border-radius: 10px;
      border: 1px solid #ccc;
      padding: 0 1em;
      box-sizing: border-box;

      &:focus {
        outline: none;
        border-color: #ff7f30;
      }
    }
  }

  .form_item_checkbox {
    display: flex;
    align-items: center;
    gap: 0.5em;

    input[type="checkbox"] {
      width: 20px;
      height: 20px;
      aspect-ratio: 1 / 1;

      /*チェックボックスの一般的なスタイルを適用*/
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      border-radius: 3px;
      border: 1px solid #ccc;
      background-color: #fff;
      cursor: pointer;
      outline: none;
      transition: all 0.2s;
      border-color: #ff7f30;

      &:checked,
      &:active {
        background-color: #ff7f30;

        /*チェックマークを表示（画像用いず）*/
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='16px' height='16px'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
        background-blend-mode: overlay;
        background-size: cover;
        background-position: center;
      }

      &:hover {
        background-color: #ff7f30;
      }
    }

    label {
      font-size: 1em;
      font-weight: normal;
      cursor: pointer;
    }
  }

  .form_item {
    input[type="submit"] {
      background: #ff7f30;
      color: #fff;
      font-size: 1.2em;
      font-weight: bold;
      border: none;
      cursor: pointer;
      text-align: center;
      transition: opacity 0.2s ease-in-out;
      padding: 0.5em 2em;
      line-height: 1;

      &:hover {
        background: #db702e;
      }
    }

    &.guide {
      font-size: 0.8em;
      color: #999;

      a {
        color: #999;
        text-decoration: underline;

        &.orange {
          color: #ff7f30;
        }
      }
    }
  }
}
