/**
 * サイト共通（フロントだけ）
 *
 * デザイン PDF は幅 1200px のカンプ。本文の幅は 1020px。
 * SP のデザインは無いので、767px 以下を SP として組む。
 */

:root {
  --color-text: #231815;
  --color-line: #231815;
  /* 薄い区切り線・枠線（記事一覧の絞り込みのボタン、SP のリスト型の区切り） */
  --color-line-light: #c8c8c8;
  --color-sub: #707070;
  --color-bg: #fff;
  /* 英字は Fira Sans（Google Fonts）、和文はヒラギノ → 游ゴシック */
  --font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", YuGothic, "Yu Gothic", sans-serif;
  --font-base: "Fira Sans", var(--font-ja);
  /* 明朝体（使う箇所は .u-font-serif を付ける）。英字は Bodoni Moda（Google Fonts）、和文はヒラギノ明朝 → 游明朝 */
  --font-serif: "Bodoni Moda", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  --content-width: 1020px;
  --gutter: 40px;
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
  }
}

/* 土台 */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* ナビの Backnumber などページ内リンクはなめらかにスクロール（動きを減らす設定では下で止める） */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 16px;
  /* 文字は全体に細め（W3 相当）。見出しは h 要素の既定（太字）にならないよう、それぞれ 300 を指定している */
  font-weight: 300;
  line-height: 1.8;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  body {
    font-size: 15px;
  }
}

img,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: inherit;
}

/* 文字の太さの方針: 日本語は見出しも本文も 300、英語の見出し（トップの Pick Up・Backnumber）だけ 400。
   見出しは h 要素の既定（太字）にならないよう、ここで 300 にする */
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
  font-weight: 300;
}

/* 本文の幅（左右の余白込み） */
.l-container {
  width: min(100% - var(--gutter) * 2, var(--content-width));
  margin-inline: auto;
}

/* 明朝体。明朝体にする箇所はこのクラスを付ける（個別の CSS で font-family を書かない） */
.u-font-serif {
  font-family: var(--font-serif);
}

/* 画面には出さず、読み上げにだけ渡す（.screen-reader-text は WordPress がページ送りなどに付けるもの） */
.u-visually-hidden,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ヘッダー */

.site-header {
  padding-top: 24px;
}

/* トップ: イラスト付きの大きいロゴ（カンプの幅 1200px いっぱい） */
.site-header--top {
  padding-top: 0;
}

.site-header--top .site-header__logo {
  width: min(100%, 1200px);
  margin-inline: auto;
}

.site-header--top .site-header__logo img {
  display: block;
  width: 100%;
}

/* 下層: 小さいロゴ。本文の幅（最大 1020px）に合わせると広い画面で中途半端に内側へ寄るので、画面の左端に置く */
.site-header--sub {
  padding-inline: var(--gutter);
}

.site-header__logo-link {
  display: inline-block;
  width: 270px;
  /* 狭い PC 幅で右上のナビとくっつかないように（SP も同じ） */
  max-width: 46%;
}

.site-header__logo-link img {
  display: block;
  width: 100%;
}

@media (max-width: 767px) {
  .site-header {
    padding-top: 16px;
  }

  .site-header--top {
    padding-top: 0;
  }

  .site-header__logo-link {
    width: 140px;
  }
}

/* ヘッダーのナビ（parts/global-nav.php）。PC は右上、SP は下層ページでロゴの右に横並び・トップはロゴの上 */

.site-header {
  position: relative;
}

.site-nav {
  position: absolute;
  top: 24px;
  right: var(--gutter);
  z-index: 100;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
}

/* 先頭の Cherry Terrace のロゴと、その下の URL（フッターと同じ画像・同じ比率。ロゴはホバーで少し大きく） */
.site-nav__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.site-nav__brand img {
  display: block;
  width: 84px;
  transition: scale 0.25s ease;
}

.site-nav__brand img.site-nav__brand-url {
  width: 106px;
  transition: none;
}

.site-nav__brand:is(:hover, :focus-visible) img:first-child {
  scale: 1.05;
}

/* 下線はホバーで左から伸びる */
.site-nav__link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  scale: 0 1;
  transform-origin: left center;
  transition: scale 0.3s ease;
}

.site-nav__link:is(:hover, :focus-visible)::after {
  scale: 1 1;
}

@media (max-width: 767px) {
  /* 開いた一覧がスライダーなど後ろの要素の下に潜らないよう、重なり順を上げる */
  .site-nav {
    position: relative;
    /* PC 用の top: 24px が relative だと効いてしまい、ロゴに重なるので打ち消す */
    top: auto;
    right: auto;
    z-index: 99;
    display: flex;
    justify-content: flex-end;
  }

  .site-header--top .site-nav {
    padding: 12px var(--gutter) 0;
  }

  /* 下層は左にロゴ、右にナビ。トップは横幅いっぱいのロゴの上の行にナビ。
     kitchen news のロゴをいちばん大きく見せる（最大 140px。ナビを縦2段にして横幅を空けているので、360px でも縮まない） */
  .site-header--sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .site-header--sub .site-header__logo-link {
    flex: 0 1 140px;
    order: -1;
    min-width: 0;
    max-width: none;
  }

  /* ナビはトップと同じ位置（上から 12px）に。ヘッダーの上の余白が 16px なので 4px 上げる */
  .site-header--sub .site-nav {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: -4px;
  }

  /* SP のナビ: 左に Cherry Terrace のロゴ（2段分の高さ）、右に Backnumber・記事一覧を縦に2段（トップも同じ） */
  .site-nav__list {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 0 16px;
  }

  .site-nav__item--brand {
    grid-row: 1 / span 2;
  }

  .site-nav__item:not(.site-nav__item--brand) {
    grid-column: 2;
  }

  .site-nav__link {
    padding: 2px 0;
    font-size: 13px;
  }

  /* URL は読めないくらい小さくてよい（ユーザー了承）。ロゴと同じ幅に */
  .site-nav__brand {
    gap: 2px;
  }

  .site-nav__brand img,
  .site-nav__brand img.site-nav__brand-url {
    width: 75px;
  }

  /* SP はホバーの下線を出さない */
  .site-nav__link::after {
    display: none;
  }
}

/* ページトップ（footer.php・assets/js/site.js）。スクロールしたら右下に出す */

.page-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--color-sub);
  border-radius: 50%;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.2s;
}

.page-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.page-top:is(:hover, :focus-visible) {
  background-color: #f2f2f2;
}

.page-top svg {
  width: 16px;
}

@media (max-width: 767px) {
  .page-top {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }
}

/* フッター
 * 寸法はすべて --s 倍（SP は 0.9）。項目ごとには縮めず、全体を同じ割合で小さくする */

.site-footer {
  --s: 1;
  margin-top: 120px;
  padding-bottom: 96px;
}

.site-footer__inner {
  display: flex;
  align-items: flex-end;
  gap: 32px 40px;
}

.site-footer__inner > * {
  flex-shrink: 0;
}

.site-footer__sites {
  display: flex;
  align-items: flex-end;
  gap: calc(24px * var(--s));
  padding: 0;
  list-style: none;
}

.site-footer__site a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

/* URL と「Recipe Website」はデザインの書体のまま画像にしている */
.site-footer__url {
  margin-top: calc(6px * var(--s));
}

.site-footer__url--cherryterrace {
  width: calc(174px * var(--s));
}

.site-footer__url--egohan {
  width: calc(131px * var(--s));
}

.site-footer__site--cherryterrace img:first-child {
  width: calc(138px * var(--s));
  transition: scale 0.25s ease;
}

.site-footer__site--cherryterrace a:is(:hover, :focus-visible) img:first-child {
  scale: 1.05;
}

.site-footer__label {
  width: calc(84px * var(--s));
  margin-bottom: calc(6px * var(--s));
}

.site-footer__pill {
  display: grid;
  place-items: center;
  width: calc(156px * var(--s));
  height: calc(62px * var(--s));
  border: 1px solid var(--color-sub);
  border-radius: 999px;
  transition: background-color 0.2s;
}

.site-footer__pill img {
  width: calc(108px * var(--s));
  transition: scale 0.25s ease;
}

.site-footer__site--egohan a:is(:hover, :focus-visible) .site-footer__pill {
  background-color: #f2f2f2;
}

.site-footer__site--egohan a:is(:hover, :focus-visible) .site-footer__pill img {
  scale: 1.08;
}

.site-footer__sns {
  display: flex;
  gap: calc(12px * var(--s));
  margin-bottom: calc(26px * var(--s));
  padding: 0;
  list-style: none;
}

.site-footer__sns a {
  display: grid;
  place-items: center;
  width: calc(62px * var(--s));
  height: calc(62px * var(--s));
  border: 1px solid var(--color-sub);
  border-radius: 50%;
  transition: background-color 0.2s;
}

.site-footer__sns a:hover {
  background-color: #f2f2f2;
}

.site-footer__sns img {
  width: calc(28px * var(--s));
  transition: scale 0.25s ease;
}

.site-footer__sns a:is(:hover, :focus-visible) img {
  scale: 1.1;
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__link::after,
  .site-nav__brand img {
    transition: none;
  }

  .site-nav__brand:is(:hover, :focus-visible) img:first-child {
    scale: none;
  }

  html {
    scroll-behavior: auto;
  }

  .site-footer__sns a:is(:hover, :focus-visible) img,
  .site-footer__site--cherryterrace a:is(:hover, :focus-visible) img:first-child,
  .site-footer__site--egohan a:is(:hover, :focus-visible) .site-footer__pill img {
    scale: none;
  }
}

.site-footer__copy {
  margin-left: auto;
  font-size: 12px;
  line-height: 1.4;
}

/* small のブラウザ既定（一回り小さく）を効かせず、12px のまま */
.site-footer__copy small {
  font-size: inherit;
}

/* 1行に入らなくなったら、リンク集を中央寄せで並べ、コピーライトは一番下の中央へ。
   さらに狭いと SNS が下の行へ回る */
@media (max-width: 1080px) {
  .site-footer__inner {
    flex-wrap: wrap;
    justify-content: center;
  }

  .site-footer__copy {
    flex-basis: 100%;
    margin-left: 0;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .site-footer {
    --s: 0.9;
    margin-top: 80px;
    padding-bottom: 48px;
  }

  .site-footer__inner {
    gap: 28px;
  }

  .site-footer__sns {
    margin-bottom: 0;
  }
}
