/**
 * 入り口ページ（index.php）。Figma「入口」（node 641:59091、1728×1042）を写す（2026-10-29）。
 * PC：寸法は Figma の px に --u（画面の幅 1728・高さ 1042 のうち狭い方に合わせた 1px）を掛ける。
 *   夜空の枠は画面いっぱいに伸び、写真は画面の形に合わせて切り抜きが変わる（前の入り口ページと同じ。2026-10-29 宮の指示「現行の入り口ページみたいに写真部分のトリミングが変化するようにして」）。
 *   紋の札・言語・扉は画面の端から Figma の間隔で置く。
 * スマホと縦向きのタブレット：紋と言語を上に、夜空の枠に白の横書きの名、その下に扉を縦に並べる（Figma にスマホの図がないので PC から組んだ）。
 *   夜空の枠は残りの高さいっぱいに伸びる。
 */
body.home {
  background: #f5f5f1 url("../img/tensha-renew/bg-news-texture.png") repeat top left / 160px 163px;
}
body.home main.top {
  height: auto;
  min-height: 100svh;
  padding: 0 !important;
}

.p-entrance {
  --u: min(100vw / 1728, 100svh / 1042);
  --texture: #f5f5f1 url("../img/tensha-renew/bg-news-texture.png") repeat top left / 160px 163px;
  position: relative;
  height: 100svh;
  min-height: 560px;
  color: #1a1a1a;
}

/* 夜空の写真の黒い角丸の枠 */
.p-entrance__stage {
  position: absolute;
  inset: calc(103 * var(--u)) calc(148 * var(--u)) calc(104 * var(--u)) calc(147 * var(--u));
  overflow: hidden;
  border-radius: calc(20 * var(--u));
  background: #000;
}
.p-entrance__stage::after {
  content: "";
  position: absolute;
  inset: 0 0 calc(30 * var(--u));
  border-radius: calc(20 * var(--u));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 96.6%, #000);
  pointer-events: none;
}
.p-entrance__mv {
  position: absolute;
  inset: calc(28 * var(--u)) calc(84 * var(--u)) calc(58 * var(--u)) calc(85 * var(--u));
  overflow: hidden;
  border-radius: calc(20 * var(--u));
}
.p-entrance__mv img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 80%; /* 横に長い画面でも、下の社殿が切れにくいように */
}
.p-entrance__logo-sp {
  display: none;
}

/* 左上の地紋の札：紋と縦書きの名 */
.p-entrance__brand {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(261 * var(--u));
  height: calc(677 * var(--u));
  border-bottom-right-radius: calc(20 * var(--u));
  background: var(--texture);
}
.p-entrance__emblem {
  position: absolute;
  top: calc(74 * var(--u));
  left: calc(70 * var(--u));
  width: calc(121 * var(--u));
  height: auto;
}
.p-entrance__name {
  position: absolute;
  top: calc(225 * var(--u));
  left: calc(76 * var(--u));
  width: calc(109 * var(--u));
  height: auto;
}

/* 右上の言語（開くとほかの言語の天社宮へ） */
.p-entrance__lang {
  position: absolute;
  z-index: 2;
  top: calc(26 * var(--u));
  right: calc(36 * var(--u));
}
.p-entrance__lang summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}
.p-entrance__lang summary::-webkit-details-marker {
  display: none;
}
.p-entrance__lang ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 8px 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
  list-style: none;
}
.p-entrance__lang a {
  display: block;
  padding: 6px 16px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.p-entrance__lang a:hover,
.p-entrance__lang a:focus-visible {
  color: #bf3823;
}
.p-entrance__lang a[aria-current] {
  font-weight: 600;
}

/* 右下の2つの扉：地紋の札（左だけ角丸）に紋・名・矢印 */
.p-entrance__doors {
  position: absolute;
  right: calc(135 * var(--u));
  bottom: calc(151 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(25 * var(--u));
}
.p-entrance__door {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(9 * var(--u));
  width: calc(349 * var(--u));
  height: calc(80 * var(--u));
  padding: 0 calc(30 * var(--u));
  border-radius: calc(10 * var(--u)) 0 0 calc(10 * var(--u));
  background: var(--texture);
  text-decoration: none;
}
.p-entrance__door-icon {
  width: calc(27 * var(--u));
  height: auto;
}
.p-entrance__door-label {
  width: calc(188 * var(--u));
  height: auto;
}
.p-entrance__door-arrow {
  width: calc(12 * var(--u));
  height: auto;
  margin-left: calc(15 * var(--u));
  transition: transform .2s ease;
}
.p-entrance__door:hover .p-entrance__door-arrow,
.p-entrance__door:focus-visible .p-entrance__door-arrow {
  transform: translateX(4px);
}
.p-entrance__door:focus-visible,
.p-entrance__lang summary:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.p-entrance__copyright {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(104 * var(--u));
  margin: 0;
  text-align: center;
  font-weight: 300;
}

@media screen and (max-width: 767px), screen and (max-width: 1180px) and (orientation: portrait) {
  .p-entrance {
    --u: 1px;
    max-width: 640px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
    width: auto;
    height: auto;
    min-height: 100svh;
    padding: 16px 16px 24px;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      "brand lang"
      "stage stage"
      "doors doors"
      "copy copy";
    align-items: start;
  }
  .p-entrance > * {
    position: static;
    inset: auto;
    min-width: 0;
  }
  .p-entrance__brand {
    grid-area: brand;
    width: auto;
    height: auto;
    background: none;
  }
  .p-entrance__emblem {
    position: static;
    display: block;
    width: 64px;
  }
  .p-entrance__name {
    display: none;
  }
  .p-entrance__lang {
    grid-area: lang;
    position: relative;
    inset: auto;
  }
  .p-entrance__stage {
    grid-area: stage;
    position: relative;
    inset: auto;
    align-self: stretch;
    width: 100%;
    height: auto;
    min-height: 320px;
    border-radius: 16px;
  }
  .p-entrance__stage::after {
    display: none;
  }
  .p-entrance__mv {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .p-entrance__mv img {
    object-position: 50% 100%;
  }
  .p-entrance__logo-sp {
    position: absolute;
    top: 24px;
    left: 50%;
    display: block;
    width: min(72%, 280px);
    height: auto;
    transform: translateX(-50%);
  }
  .p-entrance__doors {
    grid-area: doors;
    gap: 12px;
  }
  .p-entrance__door {
    width: auto;
    height: 64px;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 20px;
    border-radius: 10px;
  }
  .p-entrance__door-icon {
    width: 26px;
  }
  .p-entrance__door-label {
    width: 170px;
  }
  .p-entrance__door-arrow {
    margin-left: auto;
  }
  .p-entrance__copyright {
    grid-area: copy;
    height: auto;
  }
}
