/*
Theme Name: cafe-vibe
Theme URI: https://example.com/cafe-vibe
Author: Your Name
Author URI: https://example.com
Description: ITに不慣れなカフェオーナーでも管理画面から写真と文章を差し替えるだけで更新できる、ナチュラルで温かみのあるWordPressテーマ
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: cafe-vibe
*/

/* ------------------------------
   色・タイポグラフィ・基本設定
   ------------------------------ */

/* テーマ全体で使用するカラーバリエーション（配色ガイドラインに合わせて定義） */
:root {
  --color-bg: #ffffff;           /* 白（ベース） */
  --color-beige: #f7f1e8;        /* 温かみのあるベージュ（背景の差し色） */
  --color-brown: #6b4f3a;        /* 落ち着いたブラウン（メインカラー） */
  --color-green: #7aa88f;        /* 優しいグリーン（アクセントカラー） */
  --color-text: #2b2b2b;         /* 文章の標準色 */
  --color-muted: #8a7f73;        /* サブテキスト用の控えめな色 */

  --radius: 12px;                /* 角丸（柔らかい印象に） */
  --radius-sm: 8px;

  --container: 1200px;           /* コンテンツ最大幅 */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
}

/* 本文用の読みやすいゴシック体 */
body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 見出しは少し丸みのあるゴシック体を優先（環境依存フォントもフォールバック） */
h1, h2, h3, h4, h5, h6, .rounded-heading {
  font-family: "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--color-brown);
  line-height: 1.3;
  margin: 0 0 var(--space-6);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm); /* 画像の角をやや丸く */
}

a {
  color: var(--color-brown);
  text-decoration: none;
}
a:hover {
  opacity: 0.9;
}

/* コンテナ共通 */
.container {
  width: 92%;
  max-width: var(--container);
  margin: 0 auto;
}

/* セクションの上下余白はゆったりめに */
.section {
  padding: var(--space-16) 0;
}
.section.beige {
  background: var(--color-beige);
}

/* 見出しのスタイル（セクションタイトル） */
.section-title {
  font-size: 28px;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-8);
  position: relative;
  text-align: center; /* セクションタイトルを中央寄せ */
}
.section-title::after {
  /* タイトル下にナチュラルな下線（アクセントのグリーン） */
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  background: var(--color-green);
  border-radius: 2px;
  margin-top: var(--space-3);
  margin-left: auto;  /* 下線も中央寄せ */
  margin-right: auto; /* 下線も中央寄せ */
}

/* ボタン（角丸・柔らかい色） */
.button {
  display: inline-block;
  padding: 12px 20px;
  background: var(--color-brown);
  color: #fff;
  border-radius: var(--radius);
  transition: transform 0.05s ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button.green {
  background: var(--color-green);
  color: #fff;
}

/* ------------------------------
   ヘッダー・ナビゲーション
   ------------------------------ */

.site-header {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  justify-content: space-between;
  padding: var(--space-4) 0;
  position: relative; /* 中央付近に独自リンクを配置するため */
}
.site-branding a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--color-brown);
}
.site-title {
  font-size: 20px;
  margin: 0;
}
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-6);
}
.primary-nav a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.primary-nav a:hover {
  background: var(--color-beige);
}

/* トップページ専用：ヘッダー中央よりやや右のリンク */
.home .stores-link-header {
  position: absolute;
  left: 75%; /* 左から約75%の位置（右寄り） */
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.home .stores-link-header:hover {
  background: var(--color-beige);
}

@media (max-width: 900px) {
  .home .stores-link-header {
    position: static;
    transform: none;
    order: 2; /* ナビの手前に自然配置 */
  }
}

/* ------------------------------
   ヒーロー
   ------------------------------ */

.hero {
  position: relative;
  min-height: 84vh;
  display: grid;
  align-items: center;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: var(--color-beige);
}
.hero.has-image {
  /* 背景画像はインラインstyleで設定 */
  background-size: cover;
  background-position: center;
}
.hero::before {
  /* 画像がある場合にうっすらと全体をトーンダウンして文字可読性をUP */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  opacity: var(--overlay, 0);
  transition: opacity .2s ease;
}
.hero.has-image::before {
  --overlay: 1;
}
.hero-content {
  position: relative;
  color: #fff;
  text-align: center;
  padding: var(--space-16) 0;
}
.hero.has-slides .hero-content { position: relative; z-index: 2; }

/* ヒーロー：スライドショー */
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-catch {
  font-size: clamp(26px, 4vw, 42px);
  margin-bottom: var(--space-4);
}
.hero-sub {
  font-size: clamp(14px, 2.2vw, 18px);
  opacity: 0.95;
}

/* ------------------------------
   SHOP（2列グリッド + オーダー表）
   ------------------------------ */

.shops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}
.shop-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.shop-image img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 0;
}
.shop-body {
  padding: var(--space-6);
}
.shop-title {
  font-size: 20px;
  margin-bottom: var(--space-3);
}
.shop-text {
  color: var(--color-muted);
}

.order-table-wrap {
  margin-top: var(--space-6);
  overflow-x: auto;
}
.order-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.order-table th,
.order-table td {
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.order-table thead th {
  background: #F4EDE5;
  color: var(--color-brown);
  vertical-align: top;
}
.order-table tbody tr:nth-child(even) {
  background: #F4EDE5; /* 偶数行背景色を指定色に変更 */
}
.order-table tbody th[scope="row"] {
  text-align: left;
  white-space: nowrap;
  color: var(--color-text);
}

/* ------------------------------
   特徴（3カラムカード）
   ------------------------------ */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  text-align: center;
}
.feature-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--color-beige);
}
.feature-title {
  font-size: 18px;
  margin-bottom: var(--space-3);
}
.feature-desc {
  color: var(--color-muted);
  font-size: 14px;
}

/* ------------------------------
   メニュー（ハイライト + 小カード）
   ------------------------------ */

.menu-highlight {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  margin-bottom: var(--space-12);
}
.menu-highlight .image {
  border-radius: var(--radius);
  overflow: hidden;
}
.menu-highlight .text h3 {
  font-size: 24px;
  margin-bottom: var(--space-4);
}
.menu-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.menu-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
  .menu-card .info {
  padding: var(--space-6);
}

/* ------------------------------
   ギャラリー（カルーセル：右→左）
   ------------------------------ */
.gallery-carousel {
  overflow: hidden; /* はみ出し非表示 */
}
.gallery-track {
  display: flex;
  align-items: center;
  /* CSSのみのフォールバックアニメーション（JS有効時は無効化） */
  animation: gallery-rtl var(--gallery-speed, 30s) linear infinite;
  will-change: transform;
  backface-visibility: hidden;
}
@keyframes gallery-rtl {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.gallery-item {
  flex: 0 0 auto;
  width: clamp(140px, 20vw, 240px);
  aspect-ratio: 1 / 1;         /* 正方形 */
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  margin-right: 16px;           /* アイテム間の余白（最後だけ0に） */
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* ホバーで一時停止（任意） */
.gallery-carousel:hover .gallery-track { animation-play-state: paused; }

/* 低速端末・ユーザー設定に配慮 */
@media (prefers-reduced-motion: reduce) {
  .gallery-track { animation-duration: 1ms; animation-iteration-count: 1; }
}

/* JSで制御する場合はCSSアニメーションを停止 */
.gallery-carousel.js-enabled .gallery-track {
  animation: none !important;
}

/* ------------------------------
   ギャラリー（グリッド）
   ------------------------------ */

.gallery-carousel {
  overflow: hidden;
  width: 100%;
}
.gallery-track {
  display: flex;
  align-items: center;
  animation: gallery-marquee var(--gallery-speed, 30s) linear infinite;
}
.gallery-item { /* 個別余白で制御 */
  margin-right: var(--space-6);
}
.gallery-item {
  --gallery-item-height: 132px; /* 220pxの約60% */
  --gallery-item-width: calc(var(--gallery-item-height) * 1.5); /* 横幅を高さの約1.5倍（直前の半分） */
  flex: 0 0 var(--gallery-item-width);
  height: var(--gallery-item-height);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes gallery-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ------------------------------
   NEWS（最新3件）
   ------------------------------ */

.news-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
}
.news-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid #eee;
}
.news-date {
  color: var(--color-muted);
  font-size: 14px;
  white-space: nowrap;
  min-width: 100px;
}

/* ------------------------------
   アクセス（2カラム）
   ------------------------------ */

.access {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}
.access .box {
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.map-embed iframe {
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: var(--radius);
}

/* ------------------------------
   フッター
   ------------------------------ */

.site-footer {
  background: var(--color-beige);
  color: var(--color-text);
  padding: var(--space-12) 0;
  margin-top: var(--space-16);
  border-top: 1px solid #eee;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-4);
}

/* ------------------------------
  レスポンシブ対応
   ------------------------------ */

@media (max-width: 1024px) {
  .menu-highlight {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: 1fr 1fr;
  }
  .menu-cards, .shops-grid {
    grid-template-columns: 1fr 1fr;
  }
  .access {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .primary-nav ul {
    gap: var(--space-3);
  }
  .features {
    grid-template-columns: 1fr;
  }
  .menu-cards, .shops-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 72vh;
  }
  /* オーダー表：スマホ時は列ラベルを縦書きにして長音符を正しく表示 */
  .order-col-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
  }
  .news-item {
    flex-direction: column;
  }
  .news-date {
    min-width: auto;
  }
}

/* ------------------------------
   店舗紹介（リスト）
   ------------------------------ */
.store-list {
  display: grid;
  gap: var(--space-8);
}
.store-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-6);
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.store-thumb img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}
.store-title {
  font-size: 20px;
  margin-bottom: var(--space-3);
}
.store-desc {
  color: var(--color-muted);
}

@media (max-width: 900px) {
  .store-item {
    grid-template-columns: 140px 1fr;
  }
  .store-thumb img { width: 140px; height: 140px; }
}

@media (max-width: 600px) {
  .store-item {
    grid-template-columns: 1fr;
  }
  .store-thumb img {
    width: 100%;
    height: auto;
  }
}

/* ------------------------------
   デスクトップ向けのサイズ調整
   ------------------------------ */
@media (min-width: 901px) {
  /* 店舗紹介ページ：画像+文章の横幅を画面の約70%に */
  .page-template-page-stores .store-list {
    max-width: 70vw;
    margin-left: auto;
    margin-right: auto;
  }

  /* SHOP画像を現状の半分の高さに */
  .shop-image img {
    height: 120px;
    width: 100%;
  }
  /* オーダー表を横幅50%に縮小して中央寄せ */
  .order-table-wrap {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
  /* SHOP全体（グリッド）を半分の幅に縮小して中央寄せ */
  .shops-grid {
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
  }
  /* カード内の余白と文字サイズも少し小さく */
  .shop-body {
    padding: var(--space-4);
  }
  .shop-title {
    font-size: 18px;
  }
  .shop-text {
    font-size: 14px;
  }
}

/* オーダー表の列アイコン */
.order-col-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.order-table thead th .menu-icon { width: 48px; height: 48px; display: block; }
.order-col-label { font-size: 12px; color: var(--color-muted); line-height: 1.2; }
