/* ============================================================
   姫路のココええやん — 共通スタイル
   ヘッダー・フッター・タイポ・カラートークン
============================================================ */

:root {
  --bg:         #f3eadd;
  --paper:      #faf3e8;
  --white:      #ffffff;
  --border:     #e3d8c6;
  --border-mid: #c8b8a0;
  --rule:       #3a3530;

  --ink:        #3a3530;
  --ink-mid:    #6e655a;
  --ink-light:  #a0927e;

  --c-cream:    #e8d9bf;
  --c-rose:     #c9a3a0;
  --c-sage:     #9aa882;
  --c-teal:     #7a9090;
  --c-deepteal: #4a6266;

  --accent:     var(--c-rose);
  --accent-deep:#a87f7c;

  --serif:      'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --sans:       'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --en:         'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;

  --max:        1160px;
  --side:       300px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* CAT LABEL */
.cat-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--en);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 3px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  width: fit-content;
  line-height: 1.4;
}
.cat-label::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cat-color, var(--c-cream));
  flex-shrink: 0;
}
.cat-label::after {
  content: attr(data-jp);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--ink-mid);
  padding-left: 8px;
  border-left: 1px solid var(--border-mid);
}
.cat-label[data-jp=""]::after { display: none; }
.cat-gourmet::before { background: var(--c-rose); }
.cat-outing::before  { background: var(--c-sage); }
.cat-event::before   { background: var(--c-deepteal); }
.cat-info::before    { background: var(--c-cream); border: 1px solid var(--border-mid); }
.cat-cafe::before    { background: var(--c-rose); }
.cat-indoor::before  { background: var(--c-teal); }

.date-text {
  font-family: var(--en);
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: .14em;
}

.see-more {
  font-family: var(--en);
  font-size: .82rem;
  letter-spacing: .24em;
  color: var(--ink-mid);
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink-mid);
  transition: color .25s, border-color .25s;
}
.see-more:hover { color: var(--accent-deep); border-color: var(--accent-deep); }

.sec-title { display: flex; align-items: baseline; gap: 14px; }
.sec-title .ja {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}
.sec-title .en {
  font-family: var(--en);
  font-size: .95rem;
  letter-spacing: .32em;
  color: var(--ink-light);
  text-transform: uppercase;
}

/* HEADER */
header {
  background: rgba(243, 234, 221, .94);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  isolation: isolate;
}
/* 記事タイトル用 header 要素はナビゲーションヘッダーと区別してリセット */
header.article-head {
  position: static;
  background: none;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: auto;
}
.header-top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  height: 78px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; line-height: 1; }
.logo-mark { width: 36px; height: 36px; }
.logo-mark svg { width: 100%; height: 100%; }
.logo-text { display: flex; flex-direction: column; gap: 4px; }
.logo-text .ja {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .12em;
}
.logo-text .en {
  font-family: var(--en);
  font-size: .72rem;
  letter-spacing: .32em;
  color: var(--ink-light);
  text-transform: uppercase;
}
.header-search { flex: 1; max-width: 320px; position: relative; margin-left: auto; }
.header-search input {
  width: 100%;
  padding: 9px 16px 9px 36px;
  border: 1px solid var(--border-mid);
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .25s;
}
.header-search input:focus { border-color: var(--rule); }
.header-search::before {
  content: "";
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398897a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.header-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 32px 14px;
  display: flex;
  gap: 36px;
  border-top: 1px solid var(--border);
}
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--ink-mid);
  padding-bottom: 4px;
  transition: color .25s;
}
.header-nav a::before {
  content: attr(data-en);
  display: block;
  font-family: var(--en);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
/* 英字の色は各リンクの style="--nav-color:…"（build/site_common.py の nav_html() が categories.json の色を入れる） */
.header-nav a::before { color: var(--nav-color, currentColor); }
.header-nav a:hover { color: var(--accent-deep); }
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border-mid);
  background: transparent;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  margin-left: auto;
}
.menu-toggle span {
  width: 20px; height: 1px;
  background: var(--ink);
  transition: transform .25s, opacity .25s;
}
.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* FOOTER */
footer {
  margin-top: 120px;
  padding-top: 72px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 56px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
}
.footer-brand .logo { margin-bottom: 20px; }
.footer-brand p {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.95;
}
.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 24px;
}
.footer-links a {
  font-family: var(--en);
  font-size: 11.5px;
  letter-spacing: .26em;
  color: var(--ink-mid);
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.footer-links a:hover { color: var(--accent-deep); border-color: var(--accent-deep); }
.footer-sns { display: flex; gap: 18px; justify-content: flex-end; }
.footer-sns a {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: var(--ink-mid);
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  transition: color .25s, background .25s, border-color .25s;
}
.footer-sns a:hover {
  color: var(--white);
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.footer-sns svg { width: 15px; height: 15px; }
.footer-copy-row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 32px 30px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.footer-copy-row p {
  font-family: var(--en);
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: .26em;
  text-transform: uppercase;
}
/* FOOTER-SITEMAP:START */
/* フッターのサイトマップ欄（tools/update_footer.py が全ページに入れる。public/index.html の <style> にも同じ範囲を写す） */
.footer-sitemap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px 32px 48px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1.5fr 2fr 1fr;
  gap: 32px 40px;
}
.footer-sitemap:first-child { padding-top: 0; border-top: 0; }
.footer-sitemap .fs-head {
  font-family: var(--en);
  font-size: 11.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 16px;
}
.footer-sitemap .fs-head span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-light);
}
.footer-sitemap ul { list-style: none; }
.footer-sitemap li { margin-bottom: 9px; break-inside: avoid; }
.footer-sitemap li a {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-mid);
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.footer-sitemap li a:hover { color: var(--accent-deep); border-color: var(--accent-deep); }
.footer-sitemap .fs-area ul { columns: 2; column-gap: 20px; }
@media (max-width: 980px) {
  .footer-sitemap {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "cat about" "area area" "feature feature";
    padding: 32px 24px 36px;
    gap: 28px 24px;
  }
  .footer-sitemap .fs-cat { grid-area: cat; }
  .footer-sitemap .fs-area { grid-area: area; }
  .footer-sitemap .fs-feature { grid-area: feature; }
  .footer-sitemap .fs-about { grid-area: about; }
  .footer-sitemap .fs-area ul { columns: 3; column-gap: 16px; }
}
@media (max-width: 980px) {
  /* ハンバーガーメニューが出る幅（〜980px）ではサイトマップをメニュー（NAV-SITEMAP）で見せるので、フッターには出さない */
  .footer-sitemap { display: none; }
}
/* FOOTER-SITEMAP:END */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade { animation: fadeUp .7s ease both; }

@media (max-width: 980px) {
  .header-top { padding: 0 24px; height: 64px; }
  .menu-toggle { display: flex; }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 200;
    padding: 16px 24px 28px;
    flex-direction: column;
    gap: 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,.10);
  }
  .header-nav.is-open { display: flex; }
  .header-search { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 0 24px 40px; }
  .footer-meta { align-items: flex-start; }
  .footer-links, .footer-sns { justify-content: flex-start; }
  .footer-copy-row {
    padding: 18px 24px 24px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .header-top { padding: 0 18px; }
  .logo-mark { width: 30px; height: 30px; }
  .logo-text .ja { font-size: .95rem; }
  .logo-text .en { font-size: .65rem; }
  .footer-inner { padding: 0 18px 32px; }
  .footer-copy-row { padding: 16px 18px 22px; }
}
/* NAV-SITEMAP:START */
/* ハンバーガーメニュー内のサイトマップ（build/site_common.py の nav_sitemap_html()。tools/update_nav.py が public/index.html の <style> にも同じ範囲を写す）。
   PC は従来の横並びナビのまま。ハンバーガー表示の幅では横並びのリンクを隠し、先頭に検索欄（nav_search_html()。
   ヘッダーの .header-search はこの幅で隠れる）、続けて4グループの開閉式リストを出す */
.nav-sitemap, .nav-search { display: none; }
@media (max-width: 980px) {
  .header-nav {
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 4px;
  }
  .header-nav > a { display: none; }
  .nav-sitemap { display: block; }
  .nav-search { display: block; position: relative; margin: 8px 0 4px; }
  .nav-search input {
    width: 100%;
    padding: 11px 16px 11px 38px;
    border: 1px solid var(--border-mid);
    border-radius: 0;
    background: transparent;
    font-family: var(--sans);
    font-size: 16px; /* 16px 未満だと iOS がフォーカス時に拡大する */
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }
  .nav-search input:focus { border-color: var(--rule); }
  .nav-search input::placeholder { color: var(--ink-light); }
  .nav-search::before {
    content: "";
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398897a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  .ns-group { border-bottom: 1px solid var(--border); }
  .ns-group summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 16px 0;
    font-family: var(--en);
    font-size: 12px;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--ink-mid);
  }
  .ns-group summary::-webkit-details-marker { display: none; }
  .ns-group summary span {
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--ink-light);
  }
  .ns-group summary::after {
    content: "+";
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0;
    color: var(--ink-light);
  }
  .ns-group[open] summary::after { content: "\2212"; }
  .ns-group ul {
    list-style: none;
    padding: 0 0 18px;
    display: grid;
    gap: 14px;
  }
  .ns-area ul { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .header-nav .nav-sitemap a {
    display: block;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: .06em;
  }
  .header-nav .nav-sitemap a::before { content: none; }
  .header-nav .ns-cat a { letter-spacing: .12em; }
  .header-nav .ns-cat a::before { content: attr(data-en); }
}
/* NAV-SITEMAP:END */

/* ============================================================
   ARTICLE HERO HEAD — hero image as subtle background
============================================================ */
.article-hero-head {
  position: relative;
  overflow: hidden;
  padding-bottom: 48px;
}
.article-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.article-hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(243, 234, 221, 0.86);
}
.article-hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: blur(6px) saturate(.55) brightness(1.05);
  transform: scale(1.08);
}
.article-hero-head::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, #f3eadd);
  z-index: 1;
  pointer-events: none;
}
.article-hero-head .breadcrumb,
.article-hero-head .article-head,
.article-hero-head .article-hero-caption {
  position: relative;
  z-index: 2;
}
.article-hero-head .article-head {
  margin-top: 20px;
  margin-bottom: 0;
}
.article-hero-head .article-hero-caption {
  max-width: var(--max);
  margin: -4px auto 0;
  padding: 0 32px;
}
@media (max-width: 980px) {
  .article-hero-head { padding-bottom: 36px; }
  .article-hero-head .article-hero-caption { padding: 0 24px; }
}
@media (max-width: 600px) {
  .article-hero-head { padding-bottom: 28px; }
  .article-hero-head::after { height: 56px; }
  .article-hero-head .article-hero-caption { padding: 0 18px; }
}

/* ============================================================
   PHOTO GALLERY — 連続 figure の自動グリッド
============================================================ */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 2em 0;
}
/* 特異度を上げてインラインスタイルの .article-body figure { margin:2.4em 0 } を上書き */
.photo-gallery figure,
.article-body .photo-gallery figure { margin: 0; }
.photo-gallery figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display: block;
}
/* 奇数枚のとき最後の1枚はフル幅 */
.photo-gallery figure:last-child:nth-child(odd),
.article-body .photo-gallery figure:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.photo-gallery figure:last-child:nth-child(odd) img {
  aspect-ratio: 16 / 9;
}
@media (max-width: 600px) {
  .photo-gallery { gap: 3px; }
}

/* ============================================================
   ARTICLE HERO FIG — 最初のh2直下のヒーロー画像
============================================================ */
.article-hero-fig {
  margin: 0 0 2.4em;
  overflow: hidden;
}
.article-hero-fig img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* 副カテゴリのラベル（記事上部で主カテゴリの横に薄めに並ぶ） */
.article-head .cat-label.cat-label--sub { margin-left: 12px; opacity: .65; }

/* ============================================================
   STORY CAROUSEL — インスタのストーリーズ画面を横スワイプで見せる
   （.story-carousel > .story-track > button.story-slide > img）
   スマホは指で横スワイプ、PCは左右ボタン。タップで全画面表示（.story-viewer）
============================================================ */
.story-carousel { margin: 1.8em -18px 2.2em; }
.story-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 18px 10px;
}
.story-hint { font-size: 12px; color: var(--ink-mid); letter-spacing: .04em; }
.story-hint::before { content: "← "; }
.story-hint::after { content: " →"; }
.story-count { font-size: 12px; color: var(--ink-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-track {
  display: flex; gap: 10px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 18px;
  padding: 2px 18px 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.story-track::-webkit-scrollbar { display: none; }
.story-slide {
  flex: 0 0 64%; max-width: 250px;
  scroll-snap-align: start;
  padding: 0; border: 0; cursor: zoom-in;
  border-radius: 14px; overflow: hidden;
  background: var(--paper);
  box-shadow: 0 2px 10px rgba(58, 53, 48, .12);
  aspect-ratio: 9 / 13;
}
.story-slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.story-slide:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.story-nav { display: none; gap: 8px; }
.story-nav button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-mid); background: var(--white); color: var(--ink);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.story-nav button:disabled { opacity: .35; cursor: default; }
.story-caption { padding: 0 18px; font-size: 12px; color: var(--ink-light); }
@media (min-width: 768px) {
  .story-carousel { margin-left: 0; margin-right: 0; }
  .story-head, .story-caption { padding-left: 0; padding-right: 0; }
  .story-track { padding-left: 0; padding-right: 0; scroll-padding: 0; }
  .story-slide { flex-basis: 220px; }
  .story-nav { display: flex; }
  .story-hint { display: none; }
}
/* 全画面ビューア */
.story-viewer {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 18, 16, .94);
  display: none; flex-direction: column;
}
.story-viewer.is-open { display: flex; }
.story-viewer-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; color: #fff; font-size: 13px;
}
.story-viewer-close {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.story-viewer-track {
  flex: 1; display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.story-viewer-track::-webkit-scrollbar { display: none; }
.story-viewer-track figure {
  flex: 0 0 100%; margin: 0; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center; padding: 0 12px 20px;
}
.story-viewer-track img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
body.story-viewer-open { overflow: hidden; }

/* タグが1つもない記事では、タグ欄（.article-tags）の余白を出さない */
.article-tags:not(:has(a)) { display: none; }
