/* カスタムプロパティ */
:root {
  --contents-width: 95%;
  --contents-max-width: 1200px;
  --main-color: #2f4f4f;
  --sub-color: #800000;
  --accent-color: #1e50a2;
  --back-color: #faf0e6;
  --border-default: solid transparent 4px;
}

/* Safariのclamp用 */
* {
  min-height: 0vw;
}

/* フォント変更 */
@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../assets/fonts/ZenMaruGothic-Regular.woff2') format('woff2'),
  url('../../assets/fonts/ZenMaruGothic-Regular.woff') format('woff');
}
@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../../assets/fonts/ZenMaruGothic-Medium.woff2') format('woff2'),
  url('../../assets/fonts/ZenMaruGothic-Medium.woff') format('woff');
}
@font-face {
  font-family: 'Zen Maru Gothic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../../assets/fonts/ZenMaruGothic-Bold.woff2') format('woff2'),
  url('../../assets/fonts/ZenMaruGothic-Bold.woff') format('woff');
}

/* 調整 */
body,
button,
input,
select,
optgroup,
textarea,
label,
span {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
}

legend,
div {
  font-family: 'Zen Maru Gothic', sans-serif;
}

a {
  text-decoration: none;
  transition: .3s;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* レイアウト */
.site {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.site-header-wrapper,
.site-main,
.site-footer {
  width: var(--contents-width);
  max-width: var(--contents-max-width);
  margin: auto;
}

/* ラッパー */
.common-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  margin-top: 40px;
}

.common-wrapper--margin-bottom {
  margin-bottom: 40px;
}

.common-section-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
}

.common-section-wrapper--sub {
  gap: 24px;
}

/* 見出し */
.common-heading {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--main-color);
  background: var(--back-color);
  padding: 8px 16px;
}

.common-heading::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--main-color);
}

.common-sub-heading {
  margin-bottom: 16px;
}

.common-heading--no-margin {
  margin-bottom: 0;
}

.common-heading--center {
  text-align: center;
}

/* テキスト */
.common-text-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* ヘッダー */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: solid 1px #ccc;
  width: 100vw;
  padding-right: 8px;
}

.site-header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.site-branding {
  width: auto;
  height: auto;
}

a.custom-logo-link {
  display: flex;
}

img.custom-logo {
  max-width: 160px;
}

/* メニュー */
.menu-main {
  display: flex;
  align-items: center;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  transition: .3s;
}

.menu-icon::before,
.menu-icon::after,
.menu-icon-border {
  width: 24px;
  height: 2px;
  background: #333;
  border-radius: 1px;
  transition: .3s;
  opacity: 1;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
}

@media (hover:hover) {
  .menu-icon:hover {
    opacity: .7;
  }
}

@media (hover:none) {
  .menu-icon:active {
    opacity: .7;
  }
}

.user-icon {
  font-size: 40px;
  cursor: pointer;
}

.user-nickname {
  font-weight: bold;
  padding: 0 16px;
}

.user-nickname span {
  font-weight: normal;
}

.menu-global-menu-container {
  width: 100%;
}

.menu-close {
  display: block;
  position: relative;
  width: 30px;
  height: 30px;
  margin-right: 16px;
  align-self: flex-end;
  cursor: pointer;
}
.menu-close::before,
.menu-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 30px;
  background: #333;
}

.menu-close::before {
  transform: translate(-50%,-50%) rotate(45deg);
}

.menu-close::after {
  transform: translate(-50%,-50%) rotate(-45deg);
}

.menu-main .menu-close {
  display: none;
}

.menu-member-menu-container ul {
  flex-direction: column;
}

.user-menu-main {
  width: auto;
  min-width: 240px;
  height: auto;
  position: absolute;
  top: 0;
  right: 0;
  background: #fafafa;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding-top: 16px;
  transition: .3s;
  transform: translateY(-200%);
  opacity: 0;
}

.menu-member-menu-container {
  width: 100%;
}

.user-icon.open + .user-menu-main {
  transform: initial;
  opacity: 1;
}

.menu-item {
  transition: .1s;
}

.menu-item a {
  padding: 16px;
}

@media (hover:hover) {
  .menu-item:hover > a {
    background: #2f4f4f;
    color: #fff;
  }
}

@media (hover:none) {
  .menu-item:active > a {
    background: #2f4f4f;
    color: #fff;
  }
}

.main-navigation ul {
  gap: initial;
}

.menu-item-has-children > a[href="#"] {
  pointer-events: none;
}

.menu-item-has-children .sub-menu {
  flex-direction: column;
  background: #fff;
  float: initial;
  gap: initial;
  z-index: 10;
}

.menu-item-has-children > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.menu-item-has-children > a:after {
  content: '';
  width: 8px;
  height: 8px;
  border-top: solid 2px #333;
  border-left: solid 2px #333;
  rotate: -135deg;
  transition: .1s;
}

@media (hover:hover) {
  .menu-item-has-children:hover > a:after {
    border-color: #fff;
  }
}
@media (hover:none) {
  .menu-item-has-children:hover > a:after {
    border-color: #fff;
  }
}

.menu-item-has-children.open > a:after {
  rotate: 45deg;
  margin-top: 4px;
}

.menu-item-has-children .sub-menu {
  height: 0;
  visibility: hidden;
  opacity: 0;
  left: auto;
}

.menu-item-has-children.open .sub-menu {
  height: auto;
  visibility: visible;
  opacity: 1;
}

.menu-post-button {
  width: fit-content;
  padding: 8px 16px;
  background: var(--accent-color);
  border: var(--border-default);
  color: #fff;
  border-radius: 3px;
  font-weight: 700;
}

@media screen and (hover:hover) {
  .menu-post-button:hover {
    background: #fff;
    border-color: var(--accent-color);
    color: var(--accent-color);
  }
}

@media screen and (hover:none) {
  .menu-post-button:active {
    background: #fff;
    border-color: var(--accent-color);
    color: var(--accent-color);
  }
}

/* メインコンテンツ */
.site-main {
  padding: 40px 0;
}

.site-main--top {
  padding: 0 0 40px;
}

.map {
  display: flex;
  justify-content: center;
  max-width: 1000px;
  margin: auto;
}

.sp {
  visibility: hidden;
  width: 0;
  height: 0;
}

/* スポット一覧 */
.common-spot-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, auto);
  align-items: flex-start;
  gap: 32px;
}

.common-spot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  color: initial;
}

/* スポットの最初のアイテム */
.common-spot:first-child {
  grid-column: 1/3;
  grid-row: 1/3;
  align-self: center;
}

/* 2番目のアイテム */
.common-spot:nth-child(2) {
  grid-column: 3/4;
  grid-row: 1/2;

}

/* 3番目のアイテム */
.common-spot:nth-child(3) {
  grid-column: 4/5;
  grid-row: 1/2;
}

/* 4番目のアイテム */
.common-spot:nth-child(4) {
  grid-column: 3/4;
  grid-row: 2/3;
}

/* 5番目のアイテム */
.common-spot:nth-child(5) {
  grid-column: 4/5;
  grid-row: 2/3;
}

.common-spot-image .wp-post-image {
  box-shadow: 10px 5px 5px #eee;
  aspect-ratio: 4/3;
}

/* 先頭の画像のみ幅を100%にする */
.common-spot-list .common-spot:first-child .common-spot-image .wp-post-image,
.common-spot-list .common-spot:first-child .common-spot-image {
  width: 100%;
}

.common-spot-name {
  font-size: clamp(0.875rem, 0.85rem + 0.13vw, 1rem);
  line-height: 1.5;
  font-weight: 500;
}

/* ホバー処理 */
@media (hover:hover) {
  .common-spot:hover {
    opacity: .5;
  }
}
@media (hover:none) {
  .common-spot:active {
    opacity: .5;
  }
}

/* スポット一覧ランキング */
.common-ranking {
  counter-reset: rank;
}

.common-ranking .common-spot {
  position: relative;
}

.common-ranking .common-spot::after {
  counter-increment: rank;
  content: counter(rank) " 位";
  position: absolute;
  font-size: 1.2em;
  top: 0;
  left: 0;
  padding: 8px 16px;
  color: #fff;
  background: rgb(0 0 0 / 0.7);
}

/* 1位 */
.common-ranking .common-spot:first-child::after {
  font-weight: bold;
  background: rgb(218 165 32 / 0.9);
}

/* 2位 */
.common-ranking .common-spot:nth-child(2)::after {
  font-weight: bold;
  background: rgb(169 169 169 / 0.9);
}

/* 3位 */
.common-ranking .common-spot:nth-child(3)::after {
  font-weight: bold;
  background: rgb(148 108 69 / 0.9);
}

/* ランキング以外のスポットリスト */
.common-spot-card-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-template-rows: auto;
  align-items: flex-start;
  gap: 24px;
}

.common-spot-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  color: initial;
}

.common-spot-card-image .wp-post-image,
.common-no-image {
  box-shadow: 10px 5px 5px #eee;
  aspect-ratio: 4/3;
}

@media (hover:hover) {
  .common-spot-card:hover {
    opacity: .7;
  }
}
@media (hover:none) {
  .common-spot-card:active {
    opacity: .7;
  }
}

.common-spot-add-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto;
  gap: 24px;
}

/* フッター */
.site-footer {
  background: var(--main-color);
  color: #fff;
  width: 100vw;
  max-width: initial;
  overflow: hidden;
  padding: 24px 0;
}

.site-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: var(--contents-width);
  max-width: var(--contents-max-width);
  margin: auto;
}

.copyright {
  align-self: center;
}

.menu-footer-menu-container .menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

@media (hover:hover) {
  .menu-footer-menu-container .menu a:hover {
    opacity: .7;
  }
}

@media (hover:none) {
  .menu-footer-menu-container .menu a:active {
    opacity: .7;
  }
}

/* SNSアイコン */
.sns-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: auto;
}

.sns-icons--fixed {
  flex-direction: column;
  gap: 32px;
}

/* トップへ戻るボタン */
.common-back-to-top {
  position: fixed;
  display: flex;
  place-items: center;
  bottom: 24px;
  right: 24px;
  padding: 24px;
  border: none;
  border-radius: 50%;
  background: var(--main-color);
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: .3s;
  filter: drop-shadow(0 0 .75em #ccc);
}

.common-back-to-top::after {
  content: '';
  width: 16px;
  height: 16px;
  border-top: solid 4px #fff;
  border-right: solid 4px #fff;
  transform: rotate(-45deg);
}

.common-back-to-top.is-active {
  visibility: visible;
  opacity: 1;
}

@media (hover:hover) {
  .common-back-to-top.is-active:hover {
    background: #333;
  }
}
@media (hover:none) {
  .common-back-to-top.is-active:active {
    background: #333;
  }
}

/* いいね！ボタン */
.wpulike-default button.wp_ulike_btn {
  background: #b0c4de;
  transition: 0.3s;
}

.wpulike-default .wp_ulike_put_image:after {
  filter: brightness(0.5);
}

/* サブ画像 */
.common-spot-sub-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
}

/* ボタン関連 */
input[type="submit"],button {
  transition: .3s;
  cursor: pointer;
}

@media (hover:hover) {
  input[type="submit"]:hover,button:hover {
    opacity: .7;
  }
}
@media (hover:none) {
  input[type="submit"]:active,button:active {
    opacity: .7;
  }
}

.common-spot-more {
  display: block;
  width: fit-content;
  margin: auto;
}

/* 入力項目関連 */
input,select {
  padding: 8px;
}

.input-owner {
  width: 20px;
}

.input-image {
  border: dashed 2px #2f4f4f;
  border-radius: 12px;
}

/* 選択画像サムネイル */
.image-thumbnail {
  width: 128px;
  height: auto;
}

/* 画像クリアボタン */
.input-clear {
  background: #ccc;
  font-size: 12px;
}

/* エラーページ用 */
body#error-page {
  max-width: initial;
}

#error-page .site-header {
  display: none;
}

/* スクロールアクション */
.scroll-target {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
  transition: .7s;
}

.scroll-target.scroll-view {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 送信結果メッセージ */
.send-result-message {
  width: 100%;
  padding: 8px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 100;
  opacity: 1;
  visibility: visible;
}

.send-result-message-success {
  color: var(--main-color);
}

.send-result-message-failed {
  color: var(--sub-color);
}

.send-result-message.close {
  transition: .5s;
  opacity: 0;
  visibility: hidden;
}

/* レスポンシブ対応 */
@media screen and (max-width:768px) {
  .pc {
    visibility: hidden;
    width: 0;
    height: 0;
  }
  .sp {
    visibility: visible;
    width: auto;
    height: auto;
  }

  .site-header {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .fv-catch {
    gap: 24px;
    padding: 16px;
    width: 65%;
  }

  .top-about-heading img {
    width: 90%;
  }

  .menu-icon {
    order: 1;
  }
  .menu-main .menu-close {
    display: block;
  }

  .menu-main {
    width: auto;
    min-width: 240px;
    height: auto;
    position: absolute;
    top: 0;
    right: 0;
    background: #fafafa;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-top: 16px;
    transition: .3s;
    transform: translateY(-200%);
    opacity: 0;
  }
  .menu-icon.open + .menu-main {
    visibility: visible;
    transform: initial;
    opacity: 1;
  }
  .main-navigation ul {
    flex-direction: column;
  }

  .common-spot-list {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    row-gap: 32px;
    column-gap: 24px;
  }

  .common-spot {
    gap: 8px;
  }

  /* スポットの最初のアイテム */
  .common-spot:first-child {
    grid-column: 1/3;
    grid-row: auto;
    align-self: initial;
  }

  /* 2番目のアイテム */
  .common-spot:nth-child(even) {
    grid-column: 1/2;
    grid-row: auto;
  }

  /* 3番目のアイテム */
  .common-spot:nth-child(odd):not(:first-child) {
    grid-column: 2/3;
    grid-row: auto;
  }

  .menu-item-has-children .sub-menu {
    position: relative;
  }

  .common-back-to-top {
    bottom: 16px;
    right: 16px;
    padding: 16px;
  }
  
  .common-back-to-top::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: solid 2px #fff;
    border-right: solid 2px #fff;
  }
  .common-spot-add-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    row-gap: 32px;
    column-gap: 24px;
  }
}

@media screen and (max-width:768px) {
  .main-navigation .menu-post-button {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media screen and (max-width: 428px) {
  img.custom-logo {
    max-width: 96px;
  }
}