/* 2026 Christmas Transition - PC / SP fully separated */
/* ------------------------------------------------------------------
   PC: 全プロパティをPC側で定義（SPの指定を継承しない）
   ------------------------------------------------------------------ */
@media screen and (min-width: 768px) {
  .christmas-transition {
    --gap: 12px;
    --speed: 1650ms;
    --ease: cubic-bezier(0.76, 0, 0.24, 1);
    --edge-size: calc(17% - var(--gap) * 0.85);
    --center-size: calc(33% - var(--gap) * 1.65);
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    width: 100%;
    height: var(--hero-height);
    min-height: 580px;
    background-image: url(/img/top/2026xmas/bg.webp);
    background-size: cover;
    background-position: 50% 50%;
    overflow: visible;
        border-radius: 8px;

  }
  .christmas-transition *,
  .christmas-transition *::before,
  .christmas-transition *::after {
    box-sizing: border-box;
  }

  .christmas-transition::before {
    content: "";
    position: absolute;
    top: -8%;
    left: -8%;
    width: 116%;
    height: calc(var(--hero-height) + 16%);
    background-image: url(/img/top/2026xmas/frame.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 9;
  }

  .christmas-transition__title {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    width: 40vw;
    z-index: 10;
    pointer-events: none;
  }

  .christmas-transition__title img {
    width: 100%;
    height: auto;
    display: block;
  }

  .christmas-transition__tiles {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }
  .christmas-transition__tile {
    position: absolute;
    overflow: hidden;
    border: 5px solid rgba(221, 190, 133, 0.65);
    border-radius: 8px;
    background: #263534;
    transition:
      left var(--speed) var(--ease),
      top var(--speed) var(--ease),
      width var(--speed) var(--ease),
      height var(--speed) var(--ease),
      transform var(--speed) var(--ease),
      border-radius var(--speed) ease;
    will-change: left, top, width, height;
  }

  .christmas-transition__tile picture,
  .christmas-transition__tile img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .christmas-transition__tile a {
    display: block;
    width: 50%;
    height: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .christmas-transition__tile img {
    object-fit: cover;
    object-position: var(--position-1, center center);
    transform: translate(var(--shift-x-1, 0px), var(--shift-y-1, 0px))
      scale(var(--scale-1, 1));
    transition:
      transform 2400ms ease,
      object-position var(--speed) var(--ease);
  }
  .christmas-transition.is-columns .christmas-transition__tile img {
    object-position: var(--position-2, center center);
    transform: translate(var(--shift-x-2, 0px), var(--shift-y-2, 0px))
      scale(var(--scale-2, 1));
  }
  .christmas-transition__tile--overflow {
    overflow: visible;
    z-index: 2;
  }
  .christmas-transition__tile--overflow picture {
    overflow: visible;
  }

  /* PCの写真ごとの位置・拡大・移動設定 */
  .christmas-photo01 {
    --position-1: center 0;
    --position-2: center center;
  }
  .christmas-photo02 {
    --position-1: center 0;
    --position-2: center center;
  }
  .christmas-photo03 {
    --position-1: center 0;
    --position-2: center center;
  }
  .christmas-photo04 {
    --position-1: center 0;
    --position-2: 50% center;
  }
  .christmas-transition__tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.25), transparent 50%);
    pointer-events: none;
  }

  .christmas-photo01 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text01.png);
    background-repeat: no-repeat;
    background-size: 100% auto;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo02 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text02.png);
    background-repeat: no-repeat;
    background-size: 100% auto;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo03 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text03.png);
    background-repeat: no-repeat;
    background-size: 100% auto;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo04 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text04.png);
    background-repeat: no-repeat;
    background-size: 100% auto;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-transition__index {
    position: absolute;
    left: 20px;
    bottom: 17px;
    z-index: 1;
    font-family: "Playfair Display", sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    font-size: 2.5vmax;
    letter-spacing: 0;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    paint-order: stroke fill;
  }

  .christmas-transition__index b {
    display: block;
    font-family: "Playfair Display", sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    paint-order: stroke fill;
    font-size: 1vmax;
  }
  /* 1回目：2列×2段（各写真はボーダーを含めて完全に収まる） */
  .christmas-transition__tile--1 {
    left: var(--gap);
    top: var(--gap);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--2 {
    left: calc(50% + var(--gap) * 0.5);
    top: var(--gap);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--3 {
    left: var(--gap);
    top: calc(50% + var(--gap) * 0.5);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--4 {
    left: calc(50% + var(--gap) * 0.5);
    top: calc(50% + var(--gap) * 0.5);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  /* 2回目：左17%・中央33%×2・右17%相当（余白5本込み） */
  .christmas-transition.is-columns .christmas-transition__tile {
    top: var(--gap);
    height: calc(100% - var(--gap) * 2);
  }
  .christmas-transition.is-columns .christmas-transition__tile--1 {
    left: var(--gap);
    width: var(--edge-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--2 {
    left: calc(var(--gap) * 2 + var(--edge-size));
    width: var(--center-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--3 {
    left: calc(var(--gap) * 3 + var(--edge-size) + var(--center-size));
    width: var(--center-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--4 {
    left: calc(var(--gap) * 4 + var(--edge-size) + var(--center-size) * 2);
    width: var(--edge-size);
  }
  .christmas-transition__ui {
    position: absolute;
    inset: 24px 32px auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    letter-spacing: 0.17em;
    pointer-events: none;
    display: none;
  }
  .christmas-transition__replay {
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 100px;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.15em;
  }
  .christmas-transition__replay:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .christmas-transition.is-resetting .christmas-transition__tile,
  .christmas-transition.is-resetting .christmas-transition__tile img {
    transition: none !important;
  }
}

/* ------------------------------------------------------------------
   SP: 同じセレクタ／同じプロパティをSP側でも独立して定義
   ------------------------------------------------------------------ */
@media screen and (max-width: 767px) {
  .christmas-transition {
    --gap: 7px;
    --speed: 1500ms;
    --ease: cubic-bezier(0.76, 0, 0.24, 1);
    --edge-size: calc(15% - var(--gap) * 0.75);
    --center-size: calc(35% - var(--gap) * 1.75);
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100svh;
    height: var(--hero-height);
    min-height: 0;
    overflow: hidden;
    background-image: url(/img/top/2026xmas/bg_sp.webp);
    background-size: cover;
    background-position: 50% 50%;
  }
  .christmas-transition *,
  .christmas-transition *::before,
  .christmas-transition *::after {
    box-sizing: border-box;
  }

  .christmas-transition::before {
    content: "";
    position: absolute;
    top: -17px;
    left: -17px;
    width: calc(100% + 34px);
    height: calc(var(--hero-height) + 34px);
    background-image: url(/img/top/2026xmas/frame_sp.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 9;
  }

  .christmas-transition__title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 96vw;
    z-index: 10;
    pointer-events: none;
  }

  .christmas-transition__title img {
    width: 100%;
    height: auto;
    display: block;
  }

  .christmas-transition__tiles {
    position: absolute;
    inset: 0;
    overflow: hidden;
  }
  .christmas-transition__tile {
    position: absolute;
    overflow: hidden;
    border: 2px solid rgba(231, 193, 116, 0.9);
    border-radius: 8px;
    background: #263534;
    transition:
      left var(--speed) var(--ease),
      top var(--speed) var(--ease),
      width var(--speed) var(--ease),
      height var(--speed) var(--ease),
      transform var(--speed) var(--ease),
      border-radius var(--speed) ease;
    will-change: left, top, width, height;
  }
  .christmas-transition__tile picture,
  .christmas-transition__tile img {
    display: block;
    width: 100%;
    height: 100%;
  }

  .christmas-transition__tile a {
    display: block;
    width: 50%;
    height: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .christmas-transition__tile img {
    object-fit: cover;
    object-position: var(--position-1, center center);
    transform: translate(var(--shift-x-1, 0px), var(--shift-y-1, 0px))
      scale(var(--scale-1, 1));
    transition:
      transform 2400ms ease,
      object-position var(--speed) var(--ease);
  }
  .christmas-transition.is-columns .christmas-transition__tile img {
    object-position: var(--position-2, center center);
    transform: translate(var(--shift-x-2, 0px), var(--shift-y-2, 0px))
      scale(var(--scale-2, 1.08));
  }
  .christmas-transition__tile--overflow {
    overflow: visible;
    z-index: 2;
  }
  .christmas-transition__tile--overflow picture {
    overflow: visible;
  }
  /* SPの写真ごとの位置・拡大・移動設定 */
  .christmas-photo01 {
    --position-1: center center;
    --position-2: center 20%;
  }
  .christmas-photo02 {
    --position-1: center center;
    --position-2: center 20%;
  }
  .christmas-photo03 {
    --position-1: center center;
    --position-2: center 20%;
  }
  .christmas-photo04 {
    --position-1: center center;
    --position-2: center 20%;
  }

  .christmas-photo01 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text01.png);
    background-repeat: no-repeat;
    background-size: auto 80%;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo02 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text02.png);
    background-repeat: no-repeat;
    background-size: auto 80%;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo03 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text03.png);
    background-repeat: no-repeat;
    background-size: auto 80%;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-photo04 picture::after {
    content: "";
    position: absolute;
    top: 60%;
    right: -10px;
    width: 8vh;
    height: 100%;
    background-image: url(/img/top/2026xmas/text04.png);
    background-repeat: no-repeat;
    background-size: auto 80%;
    transform: translate(0, -50%);
    pointer-events: none;
    z-index: 9;
  }

  .christmas-transition__tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.25), transparent 50%);
    pointer-events: none;
  }
  .christmas-transition__index {
    position: absolute;
    left: 10px;
    bottom: 15px;
    font-family: "Playfair Display", sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    font-size: 2.2em;
    letter-spacing: 0;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    paint-order: stroke fill;
    z-index: 1;
  }

  .christmas-transition__index b {
    display: block;
    font-family: "Playfair Display", sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    paint-order: stroke fill;
    font-size: 1.4vmax;
  }
  /* 1回目：2列×2段 */
  .christmas-transition__tile--1 {
    left: var(--gap);
    top: var(--gap);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--2 {
    left: calc(50% + var(--gap) * 0.5);
    top: var(--gap);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--3 {
    left: var(--gap);
    top: calc(50% + var(--gap) * 0.5);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  .christmas-transition__tile--4 {
    left: calc(50% + var(--gap) * 0.5);
    top: calc(50% + var(--gap) * 0.5);
    width: calc(50% - var(--gap) * 1.5);
    height: calc(50% - var(--gap) * 1.5);
  }
  /* 2回目：上15%・中央35%×2・下15%相当（余白5本込み） */
  .christmas-transition.is-columns .christmas-transition__tile {
    left: var(--gap);
    width: calc(100% - var(--gap) * 2);
  }
  .christmas-transition.is-columns .christmas-transition__tile--1 {
    top: var(--gap);
    height: var(--edge-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--2 {
    top: calc(var(--gap) * 2 + var(--edge-size));
    height: var(--center-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--3 {
    top: calc(var(--gap) * 3 + var(--edge-size) + var(--center-size));
    height: var(--center-size);
  }
  .christmas-transition.is-columns .christmas-transition__tile--4 {
    top: calc(var(--gap) * 4 + var(--edge-size) + var(--center-size) * 2);
    height: var(--edge-size);
  }
  .christmas-transition__ui {
    position: absolute;
    inset: 16px 16px auto;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    letter-spacing: 0.17em;
    pointer-events: none;
    display: none;
  }
  .christmas-transition__replay {
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 100px;
    color: #fff;
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.15em;
  }
  .christmas-transition__replay:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .christmas-transition.is-resetting .christmas-transition__tile,
  .christmas-transition.is-resetting .christmas-transition__tile img {
    transition: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .christmas-transition__tile,
  .christmas-transition__tile img {
    transition-duration: 1ms !important;
  }
}
