#background {
    padding-bottom: 0;
}

.full-line {
    height: 0;
    margin: 0;
}

main {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    :focus:not(:focus-visible) {
        outline: 0;
    }

    [role="button"]:not([aria-disabled="true"]) {
        cursor: pointer;
    }

    img {
        max-width: 100%;
    }
}

.p-mv {
    background: url(../img/index_bg_mv_pc@2x.jpg) repeat-y 50% 0 / 100% auto;
}

.p-mv__inner {
    margin-inline: auto;
    max-width: 1200px;
    text-align: center;

    & > *:first-child {
        margin-top: 0 !important;
    }

    & > *:last-child {
        margin-bottom: 0 !important;
    }
}

.p-tvcm {
    padding-inline: 19px;
    background-color: #C70125;
}

.p-tvcm__inner {
    padding-block: 40px;

    & > *:first-child {
        margin-top: 0 !important;
    }

    & > *:last-child {
        margin-bottom: 0 !important;
    }
}

.p-tvcm__heading {
    margin-bottom: 10px;
    text-align: center;
}

.p-list-tvcm {
    display: grid;
    gap: 35px 80px;
    justify-content: center;
    margin-block: 10px;
}

@media (min-width: 481px) {
    .p-tvcm__inner {
        padding-block: 60px;
    }

    .p-tvcm__heading {
        margin-bottom: 40px;
    }

    .p-list-tvcm {
        grid-template-columns: repeat(auto-fit, 440px);
        margin-block: 40px;
    }
}

.p-media-tvcm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.p-media-tvcm__iframe {
    border: 0;
    max-width: 100%;
    width: 100%;
    height: auto;
    vertical-align: bottom;
    aspect-ratio: 16 / 9;
}

.p-media-tvcm__caption {
    text-align: center;
    color: #fff;
}

@media (min-width: 481px) {
    .p-media-tvcm {
        gap: 20px;
    }
}

@media (hover: hover) {
    .p-media-tvcm {
        &:any-link {
            cursor: pointer;
        }
    }

    .p-media-tvcm__thumbImage {
        .p-media-tvcm:any-link & {
            transition: opacity 0.5s;
            pointer-events: none;
        }

        .p-media-tvcm:any-link:hover & {
            opacity: 0.8;
        }
    }

    .p-media-tvcm__captionImage {
        .p-media-tvcm:any-link:hover & {
            opacity: 1;
        }
    }
}

.p-heading-tvcm {
    margin-block: 35px 20px;
}

.p-heading-tvcm__svg {
    display: block;
    margin-inline: auto;
    max-width: 100%;
    height: auto;
    fill: #fff;
}

/* アニメーションの共通設定 */
.p-heading-tvcm__pop-dot {
    transform-origin: 50% 50%;
    transform-box: fill-box; /* 要素自身の中心を軸にする */
    animation: popIn 4s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
    opacity: 0;

    /* 小さい順（01 -> 12）に遅延を設定 */
    &.of-dot-01 { animation-delay: 0.00s; }
    &.of-dot-02 { animation-delay: 0.12s; }
    &.of-dot-03 { animation-delay: 0.24s; }
    &.of-dot-04 { animation-delay: 0.36s; }
    &.of-dot-05 { animation-delay: 0.48s; }
    &.of-dot-06 { animation-delay: 0.60s; }
    &.of-dot-07 { animation-delay: 0.72s; }
    &.of-dot-08 { animation-delay: 0.84s; }
    &.of-dot-09 { animation-delay: 0.96s; }
    &.of-dot-10 { animation-delay: 1.08s; }
    &.of-dot-11 { animation-delay: 1.20s; }
    &.of-dot-12 { animation-delay: 1.32s; }
}

/* キーフレーム：ぽんと跳ねるような登場効果 */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    30%, 75% {
        opacity: 1;
        transform: scale(1);
    }
    90%, 100% {
        opacity: 0;
        transform: scale(0);
    }
}

.p-feature {
    padding-inline: 20px;
    background: url(../img/index_bg_feature_sp@2x.jpg) repeat-y 50% 0 / 100% auto;
}

.p-feature__inner {
    padding-block: 40px;

    & > *:first-child {
        margin-top: 0 !important;
    }

    & > *:last-child {
        margin-bottom: 0 !important;
    }
}

@media (min-width: 481px) {
    .p-feature {
        background-image: url(../img/index_bg_feature_pc@2x.jpg);
    }

    .p-feature__inner {
        padding-block: 60px;
    }
}

.p-box-feature-1 {
    position: relative;
    padding-inline: 20px;
    margin-inline: -20px;
    overflow: clip;
}

.p-box-feature-1__inner {
    position: relative;
    padding-block: 20px;
    margin-inline: auto;
    max-width: 960px;
    background-color: #fff;

    &::before,
    &::after {
        content: "";
        display: block;
        position: absolute;
        background: no-repeat 50% 50% / 100%;
        pointer-events: none;
    }

    &::before {
        left: min(calc((-15 / 405) * 100vw), -15px);
        bottom: min(calc((378 / 405) * 100vw), 378px);
        width: min(calc((167 / 405) * 100vw), 167px);
        height: min(calc((208 / 405) * 100vw), 208px);
        background-image: url(../img/index_img_feature-sand_01_sp@2x.png);
    }

    &::after {
        right: min(calc((-12 / 405) * 100vw), -12px);
        bottom: min(calc((364 / 405) * 100vw), 364px);
        width: min(calc((160 / 405) * 100vw), 160px);
        height: min(calc((222 / 405) * 100vw), 222px);
        background-image: url(../img/index_img_feature-sand_02_sp@2x.png);
    }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-100%); /* 完全に画面左外側に配置 */
  }
  100% {
    opacity: 1;
    transform: translateX(0);     /* 定位置に到着 */
  }
}

/* 右から登場 */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(100%);  /* 完全に画面右外側に配置 */
  }
  100% {
    opacity: 1;
    transform: translateX(0);     /* 定位置に到着 */
  }
}

@media (scripting: enabled) {
    .js-scrollEffects-sand {
        &::before,
        &::after {
            opacity: 0;
        }
    }

    .js-scrollEffects-sand.is-show {
        &::before,
        &::after {
            animation-delay: 1s;
            animation-duration: 0.8s;
            animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
            animation-fill-mode: forwards;
        }

        &::before {
            animation-name: slideInLeft;
        }

        &::after {
            animation-name: slideInRight;
        }
    }
}

.p-box-feature-1__speak01viewport,
.p-box-feature-1__speak02viewport,
.p-box-feature-1__speak03viewport {
    position: absolute;
}
.p-box-feature-1__speak01viewport {
    top: 0;
    left: calc((31 / 405) * 100vw);
}
.p-box-feature-1__speak02viewport {
    top: calc((45 / 405) * 100vw);
    right: calc((14 / 405) * 100vw);
}
.p-box-feature-1__speak03viewport {
    top: calc((90 / 405) * 100vw);
    left: calc((36 / 405) * 100vw);
}
@media (min-width: 481px) {
    .p-box-feature-1__speak01viewport {
        top: 0;
        left: 253px;
    }
    .p-box-feature-1__speak02viewport {
        top: 53px;
        right: 222px;
    }
    .p-box-feature-1__speak03viewport {
        top: 105px;
        left: 253px;
    }
}

/* --- Keyframes（アニメーション定義） --- */

/* 左側（伊達）からポッと飛び出す会話 */
@keyframes popFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.6);
  }
  70% {
    opacity: 1;
    transform: translateX(4px) scale(1.08); /* 弾むオーバーシュート */
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1); /* 表示したまま固定 */
  }
}

/* 右側（富澤）からポッと飛び出す会話 */
@keyframes popFromRight {
  0% {
    opacity: 0;
    transform: translateX(20px) scale(0.6);
  }
  70% {
    opacity: 1;
    transform: translateX(-4px) scale(1.08); /* 弾むオーバーシュート */
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1); /* 表示したまま固定 */
  }
}

/* メイン画像のフェードイン（下からフワッ） */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0); /* 表示したまま固定 */
  }
}

/* --- JavaScript有効時の制御 --- */
@media (scripting: enabled) {

  /* 初期状態（非表示） */
  .js-scrollEffects-sand::before,
  .js-scrollEffects-sand::after,
  .p-box-feature-1__speak01viewport,
  .p-box-feature-1__speak02viewport,
  .p-box-feature-1__speak03viewport,
  .p-box-feature-1__bodyViewport {
    opacity: 0;
  }

  /* 1. 左右の人物スライドイン（スクロール検知で発動） */
  .js-scrollEffects-sand.is-show::before,
  .js-scrollEffects-sand.is-show::after {
    animation-delay: 0.2s;
    animation-duration: 0.9s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
  }

  .js-scrollEffects-sand.is-show::before {
    animation-name: slideInLeft;
  }

  .js-scrollEffects-sand.is-show::after {
    animation-name: slideInRight;
  }

  /* 2. 吹き出しアニメーションの個別・方向指定 & ゆったりしたタイムライン */

  /* ① 伊達1（1：左からポップ） */
  .js-scrollEffects-sand.is-show .p-box-feature-1__speak01viewport {
    transform-origin: bottom left;
    animation-name: popFromLeft;
    animation-duration: 0.5s;
    animation-delay: 1.2s; /* 人物登場後、1.2秒に発動 */
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation-fill-mode: forwards; /* 表示したまま維持 */
  }

  /* ② 富澤（2：右からポップ） */
  .js-scrollEffects-sand.is-show .p-box-feature-1__speak02viewport {
    transform-origin: bottom right;
    animation-name: popFromRight;
    animation-duration: 0.5s;
    animation-delay: 2.0s; /* ゆったり2.0秒に発動 */
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation-fill-mode: forwards; /* 表示したまま維持 */
  }

  /* ③ 伊達2（3：左からポップ） */
  .js-scrollEffects-sand.is-show .p-box-feature-1__speak03viewport {
    transform-origin: bottom left;
    animation-name: popFromLeft;
    animation-duration: 0.5s;
    animation-delay: 2.8s; /* ゆったり2.8秒に発動 */
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation-fill-mode: forwards; /* 表示したまま維持 */
  }

  /* ④ メインコンテンツ（会話完了後に表示） */
  .js-scrollEffects-sand.is-show .p-box-feature-1__bodyViewport {
    animation-name: fadeInUp;
    animation-duration: 0.7s;
    animation-delay: 3.6s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards; /* 表示したまま維持 */
  }
}

.p-box-feature-1__areaHead {
    position: relative;
    z-index: 1;
    margin-inline: auto;
    width: fit-content;
}

.p-box-feature-1__areaBody {
    position: relative;
    z-index: 1;
    margin: 10px auto 0;
    width: fit-content;
}

.p-box-feature-1__areaButton {
    position: relative;
    z-index: 1;
    margin: 20px auto 0;
    width: fit-content;
}


@media (min-width: 481px) {
    .p-box-feature-1__inner {
        padding-block: 40px;

        &::before {
            left: -159px;
            bottom: 0;
            width: 420px;
            height: 548px;
            background-image: url(../img/index_img_feature-sand_01_pc@2x.png);
        }

        &::after {
            right: -159px;
            bottom: 0;
            width: 412px;
            height: 542px;
            background-image: url(../img/index_img_feature-sand_02_pc@2x.png);
        }
    }

    .p-box-feature-1__areaBody {
        margin-top: 35px;
    }

    .p-box-feature-1__areaButton {
        margin-top: 30px;
    }
}

.p-box-feature-2 {
    margin-top: 40px;
    text-align: center;
}

.p-box-feature-2__headViewport {
    display: block;
    position: relative;
    margin-inline: auto;
    width: fit-content;

    &::before,
    &::after {
        content: "";
        display: block;
        position: absolute;
        z-index: 1;
        transform-origin: bottom center;
        background: no-repeat 50% 50% / 100%;
    }

    &::before {
        left: -6px;
        bottom: -14px;
        width: 52px;
        height: 102px;
        background-image: url(../img/index_img_feature_02-1-left_sp@2x.png);
        animation: swingLeft 3s ease-in-out infinite;
    }

    &::after {
        right: -2px;
        bottom: 0;
        width: 41px;
        height: 74px;
        background-image: url(../img/index_img_feature_02-1-right_sp@2x.png);
        animation: swingRight 3s ease-in-out infinite;
    }
}

/* 左：マイナス方向（左・外側）へ振る */
@keyframes swingLeft {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-12deg);
  }
}

/* 右：プラス方向（右・外側）へ振る */
@keyframes swingRight {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

.p-box-feature-2__areaBody {
    margin-top: 30px;
}

.p-box-feature-2__areaButton {
    margin-top: 20px;
}

@media (min-width: 481px) {
    .p-box-feature-2 {
        margin-top: 70px;
    }

    .p-box-feature-2__areaBody {
        margin-top: 40px;
    }

    .p-box-feature-2__areaButton {
        margin-top: 40px;
    }

    .p-box-feature-2__headViewport {
        &::before {
            left: -43px;
            bottom: -29px;
            width: 92px;
            height: 180px;
            background-image: url(../img/index_img_feature_02-1-left_pc@2x.png);
        }

        &::after {
            right: -13px;
            bottom: -26px;
            width: 69px;
            height: 125px;
            background-image: url(../img/index_img_feature_02-1-right_pc@2x.png);
        }
    }
}

.p-box-feature-1__button,
.p-box-feature-2__button {
    display: inline-flex;
}

@media (hover: hover) {
    .p-box-feature-1__buttonImage,
    .p-box-feature-2__buttonImage {
        .p-box-feature-1__button:any-link &,
        .p-box-feature-2__button:any-link & {
            transition: opacity 0.5s;
            pointer-events: none;
        }
    }

    .p-box-feature-1__buttonImage,
    .p-box-feature-2__buttonImage {
        .p-box-feature-1__button:any-link:hover &,
        .p-box-feature-2__button:any-link:hover & {
            opacity: 0.7;
        }
    }
}

.p-recipe {
    padding-inline: 18px;
    background-color: #C70125;
}

.p-recipe__inner {
    padding-block: 40px 95px;

    & > *:first-child {
        margin-top: 0 !important;
    }

    & > *:last-child {
        margin-bottom: 0 !important;
    }
}

.p-recipe__heading {
    margin-bottom: 15px;
    text-align: center;
}

.p-list-recipe {
    display: grid;
    gap: 40px;
    justify-content: center;
    border-radius: 10px;
    padding: 40px 18px 20px;
    margin-inline: auto;
    max-width: 960px;
    background-color: #fff;
}

@media (min-width: 481px) {
    .p-recipe__inner {
        padding-block: 60px;
    }

    .p-recipe__heading {
        margin-bottom: 40px;
    }

    .p-list-recipe {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 58px;
        border-radius: 20px;
        padding: 70px 70px 60px;
    }
}

.p-card-recipe {
    display: flex;
}

.p-card-recipe__inner {
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
    text-align: center;
}

.p-card-recipe__areaImage {
    position: relative;
}

.p-card-recipe__balloon {
    position: absolute;
    top: calc((-20 / 330) * 100%);
    left: calc((-11 / 330) * 100%);
}

.p-card-recipe__thumb {
    display: block;
    border: 3px solid #C70125;
    border-radius: 5px;
    overflow: clip;
}

.p-card-recipe__thumbImage {
    width: 100%;
}

@media (min-width: 481px) {
    .p-card-recipe__inner {
        gap: 20px;
    }

    .p-card-recipe__balloon {
        top: calc((-20 / 380) * 100%);
        left: calc((-39 / 380) * 100%);
    }

    .p-card-recipe__thumb {
        border-width: 4px;
    }
}

@media (hover: hover) {
    .p-card-recipe {
        &:any-link {
            cursor: pointer;
        }
    }

    .p-card-recipe__buttonImage {
        .p-card-recipe:any-link & {
            transition: opacity 0.5s;
            pointer-events: none;
        }

        .p-card-recipe:any-link:hover & {
            opacity: 0.7;
        }
    }

    .p-card-recipe__balloonImage {
        .p-card-recipe:any-link:hover & {
            opacity: 1;
        }
    }

    .p-card-recipe__thumbImage {
        .p-card-recipe:any-link & {
            pointer-events: none;
        }

        .p-card-recipe:any-link:hover & {
            opacity: 1;
        }
    }
}

.p-series {
    padding-inline: 20px;
    background: url(../img/index_bg_series_sp@2x.jpg) repeat-y 50% 0 / 100% auto;
}

.p-series__inner {
    padding-block: 40px;

    & > *:first-child {
        margin-top: 0 !important;
    }

    & > *:last-child {
        margin-bottom: 0 !important;
    }
}

.p-series__heading {
    position: relative;
    margin: 0 auto 20px;
    width: fit-content;
    text-align: center;
}

.p-series__titleViewport {
    display: block;
    margin-top: -100px;
}

.p-series__subtitleViewport {
    display: block;
    position: absolute;
    top: 8px;
    right: 2px;
    width: fit-content;
    height: auto;
    
    /* アニメーション全体の1サイクルを 4秒 に設定 */
    animation: popFukidashi 4s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;

    /* 出現の起点（回転や縮小の軸）を吹き出しの根元（例: 左下）にする場合は調整 */
    transform-origin: bottom left;
}

/* ポンっ！と現れて消え、間を開けるキーフレーム */
@keyframes popFukidashi {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
    /* ▼ 8%（約0.3秒後）: 「ポンっ！」と少し行き過ぎる（大きく膨らむ） */
    8% {
        opacity: 1;
        transform: scale(1.15) rotate(3deg);
    }
    /* ▼ 12%（約0.5秒後）: 定位置にピタッと収まる */
    12% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    /* ▼ 12% 〜 40%（約1.1秒間）: 吹き出しを表示したまま静止 */
    40% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    /* ▼ 48%（約0.3秒間）: シュッと縮んで消える */
    48%, 100% {
        opacity: 0;
        transform: scale(0) rotate(-10deg);
    }
}

.p-list-series {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 12px;
    justify-content: center;
    margin: 30px auto;
    max-width: 962px;
}

.p-list-series__item {
    align-self: end;
    text-align: center;
}

@media (min-width: 481px) {
    .p-series {
        background-image: url(../img/index_bg_series_pc@2x.jpg);
    }

    .p-series__inner {
        padding-block: 35px 60px;
    }

    .p-series__heading {
        margin-bottom: 40px;
    }

    .p-series__titleViewport {
        margin-top: 0;
    }

    .p-series__subtitleViewport {
        top: 20px;
        right: -10px;
    }

    .p-list-series {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px 14px;
        margin-block: 40px;

        &:not(:has(li:nth-child(4))) {
            grid-template-columns: repeat(3, 1fr);
            max-width: 780px;
        }
    }
}

.p-card-series {
    display: inline-flex;
    flex-direction: column;
    gap: 20px;
}

@media (hover: hover) {
    .p-card-series {
        &:any-link {
            cursor: pointer;
        }
    }

    .p-card-series__image {
        .p-card-series:any-link:hover & {
            opacity: 1;
        }
    }

    .p-card-series__buttonImage {
        .p-card-series:any-link & {
            transition: opacity 0.5s;
            pointer-events: none;
        }

        .p-card-series:any-link:hover & {
            opacity: 0.7;
        }
    }
}

.p-media-iframe {
    border: 0;
    aspect-ratio: 300 / 150;
    width: 100%;
    vertical-align: bottom;
}

.p-dialog {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 960px;
}

.p-dialog__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
}

.p-dialog__body {
    flex-grow: 1;
    overflow: auto;
    scroll-behavior: smooth;
}

.p-dialog__placeButtonClose {
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    transform: translateY(calc(-100% - 20px));
}

.p-dialog__buttonClose {
    position: relative;
    border-radius: 50%;
    border: 0;
    padding: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    word-break: break-all;
    color: inherit;
    background-color: #c70025;

    &::before,
    &::after {
        display: block;
        content: "";
        position: absolute;
        inset: 0;
        margin: auto;
        width: 3px;
        height: 55%;
        background-color: #fff;
    }

    &::before {
        transform: rotate(45deg);
    }

    &::after{
        transform: rotate(-45deg);
    }
}

.p-dialog__buttonCloseLabel {
    position: absolute;
    z-index: -1;
}

@media (min-width: 481px) {
    .p-dialog__placeButtonClose {
        width: 48px;
        height: 48px;
        transform: translate(100%, calc(-100% - 10px));
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .p-dialog__placeButtonClose {
        transform: translate(0, calc(-100% - 10px));
    }
}

@media (scripting: enabled) {
    :root {
        --dialog: 1001;
        --modalbackdrop: 1000;
    }

    html {
        &::after {
            display: block;
            content: "";
            position: fixed;
            z-index: -1;
            inset: 0;
            margin: auto;
            background-color: rgba(0, 0, 0, 0.8);
            visibility: hidden;
            opacity: 0;
            transition: visibility 0.3s, opacity 0.3s;
        }

        &.is-modal {
            overflow: hidden;

            &::after {
                z-index: var(--modalbackdrop);
                visibility: visible;
                opacity: 1;
            }
        }
    }

    body {
        html.is-modal & {
            overflow: hidden;
        }
    }

    .js-dialog {
        position: relative;
        width: 0;
        height: 0;
        visibility: hidden;
        overflow: hidden;
        transition: opacity 0.3s, visibility 0.3s;

        &.is-show {
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 50%;
            left: 0;
            right: 0;
            z-index: var(--dialog);
            margin: auto;
            width: 100%;
            height: auto;
            max-height: calc(100% - 110px);
            transform: translateY(-50%);
            overflow: visible;
            visibility: visible;
            opacity: 1;
        }
    }

    .js-dialog__head {
            position: absolute;
            z-index: -1;
    }
}
