html {
  scroll-behavior: smooth;
}

body {
  font-family: sans-serif;
  margin: 0;
  background: #f5f5f5;
  color: #333;
}

header {
  background: #222;
  color: white;
  text-align: center;
  padding: 20px;
}

nav {
  margin-top: 10px;
}

nav a {
  color: white;
  margin: 0 10px;
  text-decoration: none;
  font-size: 14px;
}

nav a:hover {
  text-decoration: underline;
}

.layout {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.content {
  flex: 3;
  min-width: 0;
}

.sidebar {
  flex: 1;
  min-width: 240px;
  position: sticky;
  top: 20px;
}

.sidebar-box {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
}

.sidebar-box h3 {
  margin-top: 0;
}

.sidebar-box ul {
  margin: 0;
  padding-left: 18px;
}

.sidebar-box li {
  margin-bottom: 8px;
}

.sidebar-box a {
  color: #333;
  text-decoration: none;
}

.sidebar-box a:hover {
  text-decoration: underline;
}

section,
.post {
  background: white;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero {
  text-align: center;
  background: linear-gradient(135deg, #e8f4fd 0%, #fce4ec 100%);
}

.article-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.article-text {
  flex: 1;
  min-width: 240px;
}

.article-text h3 {
  margin-top: 0;
}

.photo {
  width: 100%;
  max-width: 500px;
  height: 300px;
  object-fit: cover;
}

.bridge-photo {
  object-position: bottom;
}

.detail-photo {
  width: 100%;
  max-width: 700px;
  height: auto;
  border-radius: 10px;
  display: block;
}

.mosaic-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 300px;
  flex-shrink: 0;
}

.mosaic {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  pointer-events: none;
}

.pixel {
  background: rgba(180, 180, 180, 0.95);
  opacity: 0;
  transition: opacity 0.8s ease;
}

#slideshow {
  transition: opacity 2s ease, transform 2s ease;
}

.btn,
button {
  display: inline-block;
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
  align-self: flex-start;
}

.btn:hover,
button:hover {
  background: #0056b3;
}

.single-page {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.meta {
  color: #666;
  font-size: 14px;
}

footer {
  text-align: center;
  padding: 30px 20px;
  color: #666;
}

footer a {
  color: #888;
  text-decoration: none;
  margin: 0 4px;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
  }

  .article-row {
    flex-direction: column;
  }

  .photo,
  .mosaic-wrap,
  .detail-photo {
    max-width: 100%;
  }
}

.travel-article section {
  text-align: center;
}

.travel-article section p {
  line-height: 1.9;
}

.travel-location {
  color: #999;
  font-size: 13px;
  margin-top: -4px;
}

.viewer-photo {
  width: 100%;
  height: 500px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.key-hint {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 4px 0;
}

.gallery {
  min-height: 200px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: 90px;
  gap: 12px;
  margin-bottom: 20px;
}

.thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, border 0.2s ease;
}

@media (hover: hover) {
  .thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    opacity: 1;
  }
}

.thumb.active {
  border: 2px solid #007bff;
  transform: scale(1.08);
}

.viewer {
  display: block;
  width: 100%;
  text-align: center;
}

#mainImage {
  width: 100%;
  max-width: 500px;
  height: 300px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  transition: opacity 0.25s ease;
}

.fade-out {
  opacity: 0.3;

}

.fade-in {
  opacity: 1;

}

#info {
  min-height: 28px;
  margin-top: 14px;
  font-weight: 600;
  font-size: 18px;
}

.info {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
}

#detail {
  min-height: 100px;
  margin-top: 16px;
  padding: 18px 20px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  font-size: 14px;
  line-height: 1.8;
}

.detail-box {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 80px 1fr;
  row-gap: 8px;
  font-size: 14px;
  text-align: left;
}

.detail-box strong {
  color: #666;
}

.detail-box span {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}

/* ===== スマホ最適化 完成版 ===== */
@media (max-width: 768px) {

  /* 全体余白＆文字 */
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .layout {
    margin: 16px auto;
    padding: 0 10px;
    gap: 14px;
    flex-direction: column;
  }

  .content,
  .sidebar {
    width: 100%;
  }

  .sidebar {
    position: static;
  }

  /* カード */
  section,
  .post,
  .sidebar-box {
    padding: 14px;
    border-radius: 10px;
  }

  /* ===== ギャラリー ===== */

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: 90px;
    gap: 8px;
    margin-bottom: 16px;
  }

  .thumb {
    height: 90px;
    border-radius: 8px;
  }

  /* 選択中をしっかり見せる */
  .thumb.active {
    border: 2px solid #007bff;
    transform: scale(1.05);
  }

  /* ===== メイン画像 ===== */

  #mainImage {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.2);
  }

  /* ===== タイトル ===== */

  #info {
  min-height: 28px;
    font-size: 20px;
    font-weight: 700;
    margin-top: 12px;
  }

  /* ===== 詳細カード ===== */

  #detail {
  min-height: 100px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  }

  .detail-box {
    grid-template-columns: 70px 1fr;
    row-gap: 10px;
    column-gap: 6px;
    padding: 14px;
    font-size: 13px;
  }

  .detail-box strong {
    font-size: 13px;
  }

  .detail-box span {
    font-size: 15px;
  }

  /* ===== ナビ ===== */

  nav {
    text-align: center;
  }

  nav a {
    display: inline-block;
    margin: 6px 8px;
    font-size: 13px;
  }

}

.history {
  margin-top: 40px;
}

.history h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.history-item {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.history-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
}

.history-item p {
  font-size: 12px;
  margin-top: 6px;
  color: #555;
}

.category-img {
  width: 300px;
  height: 200px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  display: block;
  background: #fff;
}

/* === 追加改善 === */

/* .photo ホバーエフェクト */
.photo {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .photo:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  }
}

/* カウンター表示 */
#info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.photo-label {
  font-weight: 600;
  font-size: 18px;
  color: #222;
}

.photo-counter {
  font-size: 13px;
  color: #999;
  font-weight: 400;
}

#info {
  display: block;
  text-align: center;
}

.photo-counter {
  display: block;
  margin-top: 4px;
}


/* 料理：洗車と同じ枠サイズで中を2分割 */
.mosaic-wrap.cooking-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 500px;   /* ←変更 */
  height: 300px;      /* ←変更 */
  overflow: hidden;
  border-radius: 10px; /* ←洗車と合わせる */
  flex-shrink: 0;
}

.mosaic-wrap.cooking-split img {
  width: 100%;
  height: 300px;      /* ←ここも揃える */
  object-fit: cover;
  display: block;
}

/* スライダー（透明） */
/* ===== Before / After スライダー ===== */

.ba-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
}

.ba-after,
.ba-before-wrap,
.ba-before {
  position: absolute;
  inset: 0;
}

.ba-after,
.ba-before {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ba-before-wrap {
  width: 50%;
  overflow: hidden;
  z-index: 2;
}

.ba-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 4;
}

.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: #fff;
  z-index: 3;
}

.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* ===== ボタン強化（プロ仕様） ===== */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ===== 画像の質感アップ ===== */
.photo {
  filter: contrast(1.05) brightness(0.98);
}

/* ===== 洗車スライダーを主役化 ===== */
#carwash .mosaic-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  background: #fff;
}

#carwash #slideshow {
  transition: opacity 1.2s ease, transform 1.8s ease;
}

#carwash .mosaic {
  border-radius: 14px;
}

#carwash .article-text {
  padding-top: 4px;
}

.btn.disabled {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 旅行だけサイズ統一 ===== */
.travel-photo {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center 70%;
  display: block;
  border-radius: 16px;
}

.category.disabled {
  color: #aaa;
  cursor: not-allowed;
  pointer-events: none;
}

nav a,
nav span {
  display: inline-block;
  margin: 0 10px;
  font-size: 14px;
}

nav span {
  color: #aaa;
}

.profile-tags {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #999;
  letter-spacing: 0.05em;
}

.profile-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  border-radius: 12px;
}

.ai-note {
  font-size: 0.8rem;
  color: #999;
  margin-top: 10px;
}

.last-updated {
  font-size: 0.78rem;
  color: #bbb;
  margin-top: 8px;
}

.coming-soon-badge {
  display: inline-block;
  font-size: 11px;
  background: #ff9800;
  color: white;
  padding: 2px 9px;
  border-radius: 20px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.sns-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.sns-list li {
  margin-bottom: 8px;
}

.sns-list a {
  color: #333;
  text-decoration: none;
}

.sns-list a:hover {
  text-decoration: underline;
}

.caption {
  font-size: 13px;
  color: #888;
  margin-top: -4px;
}

.viewer-photo.bridge-photo {
  object-position: bottom !important;
}