/* ==================================================
home.css
トップページ専用スタイル
================================================== */

/*---------------  オープニングアニメーション ---------------*/
.opening {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}
.opening.is-skipped {
    display: none;
}
.opening-clouds {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: cloud-float .5s ease-in-out infinite alternate;
}
@keyframes cloud-float {
    0% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(10px);
    }
}
.opening-cloud {
    width: 68vw;
    height: auto;
    max-width: none;
    position: absolute;
    display: block;
    opacity: 0.75;
    will-change: transform;
    transition: transform 3s cubic-bezier(0.65, 0, 0.35, 1);
}
.opening-cloud--lefttop {
    left: -2vw;
    top: -2vh;
    transition-delay: 0s;
}
.opening-cloud--leftbottom {
    left: -2vw;
    bottom: -2vh;
    transition-delay: 0.6s;
}
.opening-cloud--righttop {
    right: -2vw;
    top: -2vh;
    transition-delay: 0.4s;
}
.opening-cloud--rightbottom {
    right: -2vw;
    bottom: -2vh;
    transition-delay: 0.2s;
}
.opening.is-opening .opening-cloud--lefttop {
    transform: translate3d(-120vw, -100vh, 0);
}
.opening.is-opening .opening-cloud--leftbottom {
    transform: translate3d(-120vw, 100vh, 0);
}
.opening.is-opening .opening-cloud--righttop {
    transform: translate3d(120vw, -100vh, 0);
}
.opening.is-opening .opening-cloud--rightbottom {
    transform: translate3d(120vw, 100vh, 0);
}
@media (max-width: 767px) {
    .opening-cloud {
        width: 200vw;
    }
    .opening-cloud--lefttop,
    .opening-cloud--leftbottom {
        left: -20vw;
    }
    .opening-cloud--righttop,
    .opening-cloud--rightbottom {
        right: -20vw;
    }
    .opening-cloud--lefttop,
    .opening-cloud--righttop {
        top: -1vh;
    }
    .opening-cloud--leftbottom,
    .opening-cloud--rightbottom {
        bottom: -1vh;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .opening-cloud {
        width: 150vw;
    }
}

/*---------------  ファーストビュー ---------------*/
.first-view {
    width: 100%;
    height: 100vh;
    /* スマホのブラウザでアドレスバー等を除いた「見えている高さ」に合わせる
       （100vh はバーを隠した状態の高さになり、画面からはみ出すため）。
       svh 未対応のブラウザは上の 100vh を使う */
    height: 100svh;
    position: relative;
    overflow: hidden;
}
.fv-catch {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}
.main-catch {
    /* 縦書きのため、横書き用の YakuHanJP を含む --font_bold は使わず直接指定 */
    font-family: "Midashi Go MB31", sans-serif;
    letter-spacing: .25em;
    writing-mode: vertical-rl;
    font-size: 2.25rem;
    line-height: 2;
}
.main-catch .line {
    display: block;
    opacity: 0;
    filter: blur(16px);
    transform: translateX(20px);
}
.first-view.is-started .main-catch .line {
    animation: catch-fadein 1s ease forwards;
}
.first-view.is-started .main-catch .line:nth-child(2) {
    animation-delay: 0.4s;
}
.first-view.is-started .main-catch .line:nth-child(3) {
    animation-delay: 0.8s;
}
@keyframes catch-fadein {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(0);
    }
}
.fv-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}
.fv-image img {
    display: block;
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    height: auto;
    max-width: none;
    transform: translateX(-50%) translateY(0);
    will-change: transform, filter;
}
.first-view.is-image-started .fv-image img {
    animation: image-slide 2s ease-in-out forwards;
}
@keyframes image-slide {
    from {
        transform: translateX(-50%) translateY(0);
    }
    to {
        transform: translateX(-50%) translateY(var(--slide-distance));
    }
}
.fv-banner {
	position: absolute;
	right: 30px;
	bottom: 30px;
	z-index: 1;
}
.fv-banner__link {
	display: flex;
	align-items: center;
	gap: 16px;
	position: relative;
	padding: 12px 58px 12px 12px;
	color: #333;
	text-decoration: none;
	background: #fff;
}
.fv-banner__link::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 24px;
	width: 10px;
	height: 11px;
	background: url(../img/arrow-right-black.svg) no-repeat center / contain;
	transform: translateY(-50%);
}
.fv-banner__image {
	width: 90px;
	height: auto;
	flex-shrink: 0;
}
.fv-banner__catch,
.fv-banner__title {
	display: block;
}
.fv-banner__catch {
	font-size: 16px;
	font-weight: 700;
    font-family: var(--font_bold);
}
.fv-banner__title {
	font-size: 13px;
}
/* スマホ・タブレット：画像の高さを画面の2倍にし、上半分を表示 → 下半分までスライド
   （スライド距離は home.js で計算した --slide-distance を使う） */
@media (max-width: 1023px) {
    .fv-image img {
        width: auto;
        height: 200%;
        max-width: none;
        left: 50%;
        transform: translateX(-50%);
    }
}
@media (max-width: 767px) {
    .main-catch {
        font-size: 1.8rem;
    }
    /* バナー：左右・下に Snow Monkey 標準の余白をあけて横幅いっぱいに */
    .fv-banner {
        left: var(--_global--container-margin);
        right: var(--_global--container-margin);
        bottom: var(--_global--container-margin);
    }
    .fv-banner__catch {
        line-height: 1.4;
        margin-bottom: 8px;
    }
}
/* タブレット：バナーはPCと同じ幅のまま中央に表示 */
@media (min-width: 768px) and (max-width: 1023px) {
    .fv-banner {
        left: 0;
        right: 0;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
    }
}
@media (min-width: 1024px) {
    .fv-banner__link {
        transition: filter .2s ease-out;
    }
    .fv-banner__link:hover {
        filter: brightness(90%);
    }
    .fv-banner__link::after {
        transition: right .2s ease-out;
    }
    .fv-banner__link:hover::after {
        right: 16px;
    }
}

/* ヘッダーとバナー表示 */
.home .l-header,
.home .fv-banner {
    opacity: 0;
    animation: fadeIn .2s ease-in 6s normal both;
}
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* オープニングスキップ時（同じタブで2回目以降の表示） */
.home .l-header.is-opening-skipped,
.home .fv-banner.is-opening-skipped {
    opacity: 1;
    animation: none;
}
.first-view.is-opening-skipped .main-catch .line {
    opacity: 1 !important;
    filter: blur(0) !important;
    transform: translateX(0) !important;
    animation: none !important;
}
.first-view.is-opening-skipped .fv-image img {
    animation: none;
    transform: translateX(-50%) translateY(var(--slide-distance, 0px));
}

/*---------------  コンセプト ---------------*/
.scroll-switch .smb-section__body {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 0;
    align-items: stretch;
}
.scroll-switch__visual {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    align-self: start;
    overflow: hidden;
}
.scroll-switch__visual > .wp-block-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  z-index: 0;
  overflow: hidden;
  transition:
    opacity 1.2s ease,
    transform 1.8s ease;
  transform: scale(1.08);
}
.scroll-switch__visual > .wp-block-image.is-active {
  opacity: 1;
  z-index: 1;
  transform: scale(1);
}
.scroll-switch__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scroll-switch__content {
    min-width: 0;
    margin-top: 0; /* 画像と横並びなので、WordPressが自動でつける上の余白（ブロック間隔）を消す */
}
.scroll-switch__item {
    min-height: 65vh; /* 上下の余白を減らすため 100vh → 65vh */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
}
/* 最後のブロックは、ほかのブロック（65vh）の下に17.5vhの空きを足す
   （文章の上の間隔はほかと同じまま、文章が画面中央に来たところで画像の固定が外れるように）
   ※ほかのブロックの高さを変えるときは、ここも「高さ＝ほかの高さ÷2＋50vh」「下の空き＝50vh−ほかの高さ÷2」で合わせる */
.scroll-switch__item:last-child {
    min-height: 82.5vh;
    padding-bottom: calc(60px + 17.5vh);
}
/* 最初のブロックは、上に17.5vhの空きを足す（最後のブロックと同じ考え方を上下逆にしたもの）
   （文章の下の間隔はほかと同じまま、文章が画像の中央の高さにくるように） */
.scroll-switch__item:first-child {
    min-height: 82.5vh;
    padding-top: calc(60px + 17.5vh);
}
.scroll-switch__item p {
    line-height: 2.4;
}
/* PC：本文を20pxに */
@media (min-width: 1024px) {
    .scroll-switch__item p {
        font-size: 20px;
    }
}
/* スマホ・タブレット用（PCでは非表示のブロック）：タブレットのときだけ画像を幅70%・中央ぞろえ */
@media (min-width: 768px) and (max-width: 1023px) {
    .image-reveal.wp-block-hidden-desktop .wp-block-image {
        width: 70%;
        margin-left: auto;
        margin-right: auto;
    }
}

/*--------------- イメージ動画 ---------------*/
.bg-fixed {
    min-height: 100vh;
}
.bg-fixed .smb-section {
    width: 100%;
    height: 100%;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}
.bg-fixed .smb-section .smb-section-with-bgimage__bgimage {
    height: 100%;
    position: relative;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
}
.bg-fixed .smb-section .smb-section-with-bgimage__bgimage video {
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}
/* スマホ・タブレット：高さを画面の70%に */
@media (max-width: 1023px) {
    .bg-fixed {
        min-height: 70vh;
    }
}

/*--------------- 晴れまちとは ---------------*/
/* スマホ：ロゴを幅160pxに（編集画面のサイズ指定 width:180px を上書きするため !important） */
@media (max-width: 767px) {
    .bg-fixed + .smb-section .wp-block-image.is-resized img {
        width: 160px !important;
    }
    /* 段落を16pxに（編集画面の文字サイズ指定 has-sm-l-font-size の !important を上書きするため !important） */
    .bg-fixed + .smb-section p.wp-block-paragraph {
        font-size: 16px !important;
    }
}

/*--------------- NEWS ---------------*/
.sect-top-news .c-entries {
    --entries--item-width: 25%;
}
/* スマホ：2カラム */
@media (max-width: 767px) {
    .sect-top-news .c-entries {
        --entries--item-width: 50%;
    }
}
.sect-top-news .c-entries .c-entry-summary__figure {
    margin-bottom: 10px;
    background-color: transparent;
}
.sect-top-news .c-entries .c-entry-summary__header {
    margin-bottom: 5px;
}
.sect-top-news .c-entries .c-entry-summary__title {
    font-size: 1rem;
    font-weight: 400;
	line-height: 1.4;
}
.sect-top-news .c-entries .c-entry-summary__meta {
    margin-top: 0;
    font-weight: 400;
	line-height: 1.4;
    color: #666;
    justify-content: flex-start;
}
@media (max-width: 767px) {
    .sect-top-news .c-entries .c-entry-summary__title {
        font-size: 14px;
    }
}

/*--------------- STORY & EVENT ---------------*/
/* スライダー */
.custom-post-slider {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}
.custom-post-slider__track {
    display: flex;
    gap: 30px;
    width: calc(100% + (100vw - (100% / 0.6667)) / 2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.custom-post-slider__track::-webkit-scrollbar {
    display: none;
}
.custom-post-slider__spacer {
    flex: 0 0 auto;
    height: 1px;
    pointer-events: none;
}
.custom-post-slider__item {
    flex: 0 0 60%;
    min-width: 0;
    scroll-snap-align: start;
}
/* 認定品マーキーと同じく、奇数番目を下げて高さをバラバラにする */
.custom-post-slider__item:nth-child(odd) {
    margin-top: 48px;
}
.custom-post-slider__item a {
    display: block;
    color: inherit;
    text-decoration: none;
}
.custom-post-slider__image {
    aspect-ratio: 3 / 2;
    overflow: hidden;
}
.custom-post-slider__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.custom-post-slider__title {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 18px;
}

/* ナビゲーション */
.custom-post-slider__navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-top: 30px;
    padding: 0;
}
.custom-post-slider__arrows {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.custom-post-slider__navigation button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex: 0 0 42px;
    margin: 0;
    padding: 0;
    border: none;
    background: #333;
    cursor: pointer;
    font-size: 20px;
}
.custom-post-slider__navigation button img {
    width: 10px;
    height: 11px;
}
@media (max-width: 767px) {
    .custom-post-slider__track {
        gap: 15px;
    }
    .custom-post-slider__item {
        flex: 0 0 85%;
    }
    .custom-post-slider__item:nth-child(odd) {
        margin-top: 40px;
    }
    .custom-post-slider__title {
        font-size: 16px;
    }
    .custom-post-slider__navigation {
        width: 100% !important;
    }
}
/* カラムが縦並びになる幅：スライダーを画面の右端まで広げる
   （上の width の計算はPCの2カラム配置用のため、縦並びでは右端に届かない） */
@media (max-width: 781px) {
    .custom-post-slider__track {
        width: calc(100% + var(--_global--container-margin));
    }
}
@media (min-width: 1024px) {
    .custom-post-slider__navigation button {
        transition: filter .2s ease-out;
    }
    .custom-post-slider__navigation button:hover {
        filter: brightness(200%);
    }
}

/*--------------- 認定品 ---------------*/
.custom-post-marquee {
    width: 100vw !important;
    max-width: none !important;
    position: relative;
    left: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    overflow: hidden;
    margin-top: var(--_margin3);
}
/* .custom-post-marquee-track {
    display: flex;
    width: max-content;
    animation: customPostMarquee 48s linear infinite;
} */
.custom-post-marquee-track {
    display: flex;
    width: max-content;
    animation: customPostMarquee var(--marquee-duration, 48s) linear infinite;
}
@keyframes customPostMarquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}
.custom-post-marquee-group {
    display: flex;
    flex-shrink: 0;
    gap: 30px;
    padding-right: 30px;
}
.custom-post-marquee-item {
    display: block;
    flex: 0 0 300px;
    width: 300px;
    text-decoration: none;
    color: inherit;
}
.custom-post-marquee-item:nth-child(odd) {
    margin-top: 30px;
}
.custom-post-marquee-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.custom-post-marquee-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.custom-post-marquee-title {
    margin: 10px 0 4px;
    line-height: 1.4;
    /* 見出しと同じ太字のフォント（カードを複製して流すため、h3 にはしていない） */
    font-family: var(--font_bold);
    font-weight: 700;
}
.custom-post-marquee-business {
    font-size: 12px;
    line-height: 1.4;
    color: #666;
}
@media (max-width: 767px) {
    .custom-post-marquee-group {
        gap: 15px;
        padding-right: 15px;
    }
    .custom-post-marquee-item {
        flex: 0 0 210px;
        width: 210px;
    }
    .custom-post-marquee-image {
        height: 140px;
    }
    .custom-post-marquee-item p {
        font-size: 12px;
    }
    .custom-post-marquee-item .custom-post-marquee-title {
        font-size: 14px;
    }
}
/* スマホ・タブレット：自動では流さず、横スワイプで動かす */
@media (max-width: 1023px) {
    .custom-post-marquee {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-left: var(--_global--container-margin);
        scrollbar-width: none;
    }
    .custom-post-marquee::-webkit-scrollbar {
        display: none;
    }
    .custom-post-marquee-track {
        animation: none;
    }
    /* ループ用の複製（2セット目・奇数件のときの追加分）は使わないので非表示 */
    .custom-post-marquee-group[aria-hidden="true"],
    .custom-post-marquee-item.is-duplicate {
        display: none;
    }
    /* 左右の端に Snow Monkey 標準の余白をあける */
    .custom-post-marquee-group {
        padding-left: var(--_global--container-margin);
        padding-right: var(--_global--container-margin);
    }
    .custom-post-marquee-item {
        scroll-snap-align: start;
    }
    /* 矢印：一覧の下・右寄せ（STORY・EVENT より間隔を詰める） */
    .custom-post-marquee-navigation {
        margin-top: 10px;
    }
}
/* 矢印：PCでは自動で流れるので非表示 */
@media (min-width: 1024px) {
    .custom-post-marquee-navigation {
        display: none;
    }
}
@media (min-width: 1024px) {
    /* 周りを薄くする */
    /* .custom-post-marquee-item {
        opacity: 1;
        transition: opacity 0.2s ease;
    }
    .custom-post-marquee-track:has(.custom-post-marquee-item:hover)
    .custom-post-marquee-item:not(:hover) {
        opacity: 0.3;
    }
    .custom-post-marquee-item:hover {
        opacity: 1;
    } */
}

/*--------------- ホバーアニメーション ---------------*/
@media (min-width: 1024px) {

    /* カスタム投稿スライダー */
    .custom-post-slider__item a {
        transition: filter 0.2s ease-out;
    }
    .custom-post-slider__item a:hover {
        filter: brightness(80%);
    }
    .custom-post-slider__image img {
        transition: transform 0.3s ease-out;
    }
    .custom-post-slider__item a:hover
    .custom-post-slider__image img {
        transform: scale(1.02);
    }

    /* カスタム投稿マーキー */
    .custom-post-marquee-item {
        filter: brightness(100%);
        transition: filter 0.2s ease-out;
    }
    .custom-post-marquee-item:hover {
        filter: brightness(80%);
    }
    .custom-post-marquee-track:has(.custom-post-marquee-item:hover) {
        animation-play-state: paused;
    }
    .custom-post-marquee-image img {
        transition: transform 0.3s ease-out;
    }
    .custom-post-marquee-item:hover .custom-post-marquee-image img {
        transform: scale(1.02) !important;
    }  

    /* 最近の投稿 */
    .c-entries__item > a .c-entry-summary__figure img {
        transition: transform 0.3s ease-out;
    }
    .c-entries__item > a:hover .c-entry-summary__figure img {
        transform: scale(1.02) !important;
    }
}

/*--------------- 画像アニメーション ---------------*/
.image-reveal .imgwrap {
    overflow: hidden;
}
.image-reveal .imgwrap img {
    opacity: 0;
    transform: scale(1.08);
    transition:
        opacity 1s ease-out,
        transform 1s ease-out,
        filter 0.2s ease-out;
}
.image-reveal .imgwrap.is-revealed img {
    opacity: 1;
    transform: scale(1);
}
.image-reveal .imgwrap.is-hover-ready img {
    transition:
        opacity 1s ease-out,
        transform 0.3s ease-out,
        filter 0.2s ease-out;
}
/* 認定品マーキー：画面外から流れてくる画像はアニメーションなしで表示 */
.image-reveal .imgwrap.is-no-reveal:not(.is-hover-ready) img {
    transition: none;
}

/* 最近の投稿ブロック */
.c-entry-summary__figure.imgwrap {
    overflow: hidden;
}
.image-reveal .c-entry-summary__figure.imgwrap img {
    opacity: 0;
    transform: scale(1.08);
    transition:
        opacity 1s ease-out,
        transform 1s ease-out,
        filter 0.2s ease-out;
}
.image-reveal .c-entry-summary__figure.imgwrap.is-revealed img {
    opacity: 1;
    transform: scale(1);
}
.image-reveal .c-entry-summary__figure.imgwrap.is-hover-ready img {
    transition:
        opacity 1s ease-out,
        transform 0.3s ease-out,
        filter 0.2s ease-out;
}

/*--------------- 晴れまちFARM ---------------*/
/* スマホ：4つの画像（グリッド配置のグループ）のすき間を15pxに */
@media (max-width: 767px) {
    .wp-block-group.is-layout-grid {
        gap: 15px;
    }
}

/*--------------- ボタン ---------------*/
/* スマホ：ボタンを幅100%に */
@media (max-width: 767px) {
    .smb-buttons {
        width: 100%;
    }
    .smb-buttons .smb-btn-wrapper,
    .smb-buttons .smb-btn {
        width: 100%;
    }
}
