/* ==========================================================================
   sub-common.css
   下層ページのみで使用する共通スタイル（トップページでは読み込まない）
   ========================================================================== */

.l-main {
  overflow-x: clip;
}

.sub-inner {
  width: 100%;
  max-width: var(--sub-inner);
  margin: 0 auto;
  padding: 0 24px;
}

/* アニメーション（products.php のアイコン・about / contact / order のふわふわで使用） */
@keyframes c-sun-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes c-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-14px) rotate(1deg);
  }
}

/* ==========================================================================
   c-anchor-nav（ページ内リンク：ころころした丸ボタン）
   ========================================================================== */
.c-anchor-nav {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
  margin: -10px auto 0;
  padding: 0 20px;
  list-style: none;
}

.c-anchor-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px 12px 14px;
  border: 2px dashed var(--color-main);
  border-radius: 50px;
  background: #fff;
  color: var(--color-main);
  font-weight: 700;
  letter-spacing: 0.08em;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.3s,
    color 0.3s;
}

.c-anchor-nav a span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-sun);
  color: #8c1313;
  font-size: 0.85rem;
  transition: transform 0.4s ease;
}

.c-anchor-nav a:hover {
  opacity: 1;
  background: var(--color-main);
  color: #fff;
  transform: translateY(-4px) rotate(-2deg);
}

.c-anchor-nav a:hover span {
  transform: rotate(360deg);
}

/* ==========================================================================
   c-pop（ふわっと浮かび上がる登場アニメーション）
   親に .js-inview、アニメーションさせたい要素に .c-pop を付ける。
   ========================================================================== */
.c-pop {
  opacity: 0;
  transform: translateY(30px) scale(0.97);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.js-inview.is-inview .c-pop,
.js-inview.is-inview.c-pop {
  opacity: 1;
  transform: none;
}

.c-pop--d1 {
  transition-delay: 0.1s;
}
.c-pop--d2 {
  transition-delay: 0.2s;
}
.c-pop--d3 {
  transition-delay: 0.3s;
}
.c-pop--d4 {
  transition-delay: 0.4s;
}

@media (prefers-reduced-motion: reduce) {
  .c-pop {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   セクション背景の共通パーツ
   ========================================================================== */
.c-sec {
  position: relative;
  padding: 60px 0;
}

.c-sec--pink {
  background-color: var(--color-pink);
}

.c-sec--cream {
  background-color: var(--color-cream);
}

/* ピンク地の上下をトップページと同じ波線でつなぐ */
.c-wave {
  display: block;
  width: 100%;
  height: 50px;
  line-height: 0;
  background: url("../img/bk/curve-pink-rule.png") center / 100% 100% no-repeat;
  /* curve-pink-rule.png は「上がピンク・下が白」の絵なので、
     ピンクの区切りの上（白 → ピンク）に置く .c-wave は上下を反転させる */
  transform: scaleY(-1);
}

/* ピンクの区切りの下（ピンク → 白）は画像のまま */
.c-wave--flip {
  transform: none;
}

/* c-btn の黄色バリエーション（目立たせたいボタン用） */
.c-btn--sun {
  border-color: #8c1313;
  background: var(--color-sun);
  color: #8c1313;
  box-shadow: 0 6px 0 #e3ad1d;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.3s,
    color 0.3s;
}

.c-btn--sun:hover {
  background: var(--color-sun);
  color: #8c1313;
  transform: translateY(3px);
  box-shadow: 0 3px 0 #e3ad1d;
}

/* c-btn の赤ベタ版 */
.c-btn--solid {
  border-style: solid;
  background: var(--color-main);
  color: #fff;
  box-shadow: 0 6px 0 #8c1313;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.c-btn--solid:hover {
  background: var(--color-main);
  transform: translateY(3px);
  box-shadow: 0 3px 0 #8c1313;
}

@media screen and (max-width: 900px) {
  .c-sec {
    padding: 70px 0;
  }

  .c-sec-ttl {
    margin-bottom: 40px;
  }
}

@media screen and (max-width: 600px) {
  .sub-inner {
    padding: 0 15px;
  }

  .c-anchor-nav {
    gap: 10px;
  }

  .c-anchor-nav a {
    padding: 9px 16px 9px 10px;
    font-size: 0.9rem;
  }

  .c-anchor-nav a span {
    width: 26px;
    height: 26px;
  }

  .c-sec {
    padding: 56px 0;
  }
}

/* ---------------------------------------
   c-news-list（お知らせ一覧ページの行表示）
   render_news_item()（manage/includes/news_helper.php）が出力する
   .news-item系クラスに対して、行レイアウトのスタイルを当てる。
--------------------------------------- */
.c-news-list {
  display: flex;
  flex-direction: column;
  margin-top: 50px;
}

.c-news-list .news-item {
  border-bottom: 1px solid #eee;
}

.c-news-list .news-item-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 22px 8px;
}

.c-news-list .news-item-date {
  flex: 0 0 auto;
  color: #999;
  font-size: 0.95rem;
}

.c-news-list .news-item-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background-color: var(--color-yellow);
  color: var(--color-main-dark);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.c-news-list .news-item-category {
  flex: 0 0 auto;
  padding: 3px 14px;
  border: 1px solid var(--color-main);
  border-radius: 20px;
  color: var(--color-main);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.c-news-list .news-item-title {
  flex: 1 1 auto;
  min-width: 200px;
}

.c-news-list .news-item-title-text {
  font-size: 1rem;
  font-weight: 500;
}

.news-empty {
  padding: 60px 0;
  text-align: center;
  color: #999;
  font-size: 1.05rem;
}

/* ---------------------------------------
   c-pagination
--------------------------------------- */
.c-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 48px;
}

.c-pagination__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 50%;
  color: var(--color-text);
  font-size: 0.95rem;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

.c-pagination__link.is-active {
  background-color: var(--color-main);
  border-color: var(--color-main);
  color: var(--color-white);
  opacity: 1;
}

.c-pagination__link.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

@media screen and (max-width: 767px) {
  .c-news-list .news-item-link {
    padding: 20px 4px;
  }

  .c-news-list .news-item-title {
    flex: 1 1 100%;
    order: 3;
  }

  .c-news-list .news-item-title-text {
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   c-modal（ギャラリー・注文確認で共通使用するモーダル）
   ========================================================================== */
.c-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.c-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.c-modal__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 207, 63, 0.25), transparent 60%), rgba(60, 12, 12, 0.72);
  backdrop-filter: blur(3px);
}

.c-modal__box {
  position: relative;
  width: min(100%, 880px);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 36px;
  background: #fff;
  box-shadow:
    0 0 0 6px var(--color-sun),
    0 30px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.85) rotate(-2deg);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.c-modal.is-open .c-modal__box {
  transform: none;
}

.c-modal__figure {
  margin: 0;
}

.c-modal__img {
  position: relative;
  background: var(--color-pink);
  line-height: 0;
}

.c-modal__img img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.c-modal__caption {
  padding: 26px 40px 34px;
}

.c-modal__caption.is-empty {
  display: none;
}

.c-modal__title {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 18px;
  border-radius: 30px;
  background: var(--color-main);
  color: #fff;
  font-weight: 700;
}

.c-modal__title:empty {
  display: none;
}

.c-modal__text {
  font-family: var(--font-round);
  line-height: 2;
  white-space: pre-wrap;
}

.c-modal__close {
  position: sticky;
  top: 14px;
  float: right;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 14px 14px -62px 0;
  border-radius: 50%;
  background: var(--color-main);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 0 0 4px #fff;
  transition: transform 0.3s ease;
}

.c-modal__close:hover {
  transform: rotate(90deg);
}

/* 前後の写真へのボタン：写真（.c-modal__img）の下端に重ね、写真が透けて見えるよう半透明にする */
.c-modal__nav {
  position: absolute;
  bottom: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 207, 63, 0.6);
  color: #8c1313;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

.c-modal__nav--prev {
  left: 14px;
}
.c-modal__nav--next {
  right: 14px;
}

.c-modal__nav:hover,
.c-modal__nav:focus-visible {
  background: rgba(255, 207, 63, 0.95);
  transform: scale(1.12);
}

.c-modal__nav[hidden] {
  display: none;
}

body.is-modal-open {
  overflow: hidden;
}

@media screen and (max-width: 600px) {
  .c-modal {
    padding: 12px;
  }

  .c-modal__box {
    border-radius: 24px;
  }

  .c-modal__caption {
    padding: 20px 22px 26px;
  }

  .c-modal__nav {
    bottom: 10px;
    width: 40px;
    height: 40px;
  }

  .c-modal__close {
    width: 42px;
    height: 42px;
    margin-bottom: -56px;
  }
}

.u-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   p-pagetop（下層ページのページトップ：画像タイトル＋写真＋流れる帯）
   includes/page-top.php で出力する。
   タイトルは title-bk.png（黄色マーカー）を先に表示し、
   0.5s 後に文字画像が下からふわっと上がってくる。
   ========================================================================== */
.p-pagetop {
  --slide-h: 180px;
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  background: #fff;
  /* margin-bottom: 50px; */
}

.p-pagetop__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 47%;
  align-items: center;
  gap: 40px;
  padding: 0 5% 0 4%;
  max-width: 1560px;
  margin: auto;
}

/* 左：タイトル（2枚の画像を重ねる） */
.p-pagetop__ttl {
  position: relative;
  justify-self: center;
  width: min(85%, 560px);
  line-height: 0;
}

.p-pagetop__ttl img {
  display: block;
  width: 100%;
  height: auto;
}

/* 文字画像にも title-bk.png と同じ左上の点線が描かれているため、
   その部分を切り抜いて点線が二重に動いて見えないようにする */
.p-pagetop__ttl-txt {
  position: absolute;
  inset: 0;
  clip-path: polygon(12.9% 0, 100% 0, 100% 100%, 0 100%, 0 36.7%, 8% 36.7%, 8% 28%, 9.8% 28%, 9.8% 20%, 12.9% 20%);
  transform-origin: 50% 100%;
}

/* 画像のデコードが終わるまで待ってから再生する（page-top.php のスクリプトで付け替え） */
.p-pagetop__ttl.is-loading img {
  opacity: 0;
}

.p-pagetop__ttl.is-ready .p-pagetop__ttl-bk {
  animation: p-pagetop-fade 0.3s ease-out both;
}

.p-pagetop__ttl.is-ready .p-pagetop__ttl-txt {
  will-change: transform, opacity;
  animation: p-pagetop-rise 0.5s 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes p-pagetop-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes p-pagetop-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) rotate(-15deg);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

/* 右：写真（点線の枠は画像に含まれている） */
.p-pagetop__photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* 下部：右から左へ流れ続ける帯 */
.p-pagetop__slide {
  --slide-w: calc(var(--slide-h) * 487 / 186);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: var(--slide-h);
  background: url("../img/sub-photo/page-top-slide-2.png") 0 0 / auto 100% repeat-x;
  animation: p-pagetop-slide 14s linear infinite;
  pointer-events: none;
}

@keyframes p-pagetop-slide {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: calc(var(--slide-w) * -1);
  }
}

/* タブレット */
@media screen and (max-width: 1024px) {
  .p-pagetop {
    --slide-h: 140px;
  }

  .p-pagetop__ttl {
    width: min(90%, 560px);
  }

  .p-pagetop__inner {
    grid-template-columns: 1fr 50%;
    gap: 24px;
    padding: 0 4%;
  }

  .p-pagetop__slide {
    bottom: 0;
  }
}

/* スマートフォン：タイトル → 写真の縦並び */
@media screen and (max-width: 767px) {
  .p-pagetop {
    --slide-h: 100px;
    padding: calc(var(--header-height) + 10px) 0 56px;
  }

  .p-pagetop__inner {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 16px;
  }

  .p-pagetop__ttl {
    width: min(100%, 420px);
  }

  .p-pagetop__photo {
    justify-self: center;
    width: min(92%, 480px);
  }

  .p-pagetop__slide {
    bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .p-pagetop__ttl.is-ready img,
  .p-pagetop__slide {
    animation: none;
  }
}

/* ==========================================================================
   c-sub-heading（英語ロゴ画像＋赤い見出し：下層ページのセクション見出し）
   英語ロゴは index.php の c-heading と同じく、画面に入るたびに
   傾いた状態からふわっと起き上がる。トリガーは親（または自身）の .js-inview。
   ========================================================================== */
.c-sub-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
  text-align: center;
}

.c-sub-heading__en {
  display: block;
  width: min(300px, 60vw);
  height: auto;
  margin-left: -50px;
  opacity: 0;
  transform: rotate(-10deg);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.is-inview .c-sub-heading__en {
  opacity: 1;
  transform: rotate(0deg);
}

.c-sub-heading__ja {
  position: relative;
  margin-top: -14px;
  font-size: clamp(1.75rem, 2.6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.1em;
  color: var(--color-main);
}

.c-sub-heading__sub {
  margin-top: 12px;
  font-family: var(--font-round);
  font-weight: 700;
  color: #8c5a5a;
}

@media screen and (max-width: 767px) {
  .c-sub-heading {
    margin-bottom: 36px;
  }

  .c-sub-heading__en {
    width: min(230px, 62vw);
    margin-left: -30px;
  }

  .c-sub-heading__ja {
    margin-top: -10px;
  }

  .c-sub-heading__sub {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .c-sub-heading__en {
    transition: none;
  }
}
