:root {
  --bg: #faf8f4;
  --fg: #1a1a1a;
  --muted: #767676;
  --gap: 28px;
}

/* ページ遷移時に軽くクロスフェードさせる（対応ブラウザのみ、非対応でも通常の遷移になるだけ） */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "M PLUS 1", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

a {
  color: inherit;
}

/* どのページからも表紙へ戻れる、常設の小さなマーク */
/* filterとclip-pathを同じ要素に付けるとSafariで影がclip-pathの境界に切られて消えるため、影は外側のwrapperに分離する */
.site-mark-wrap {
  position: fixed;
  top: 24px;
  right: 0;
  z-index: 10;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
}

.site-mark-wrap.is-deferred {
  transform: translateX(120%);
  transition: transform 0.35s ease;
}

.site-mark-wrap.is-deferred.is-revealed {
  transform: translateX(0);
}

.site-mark {
  display: block;
  text-decoration: none;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 16% 50%, 0 0);
}

.site-mark__shape {
  height: 32px;
  padding: 0 22px 0 34px;
  display: flex;
  align-items: center;
  background: #f0f0ee;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 16% 50%, 0 0);
}

.site-mark__text {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* メニュー: 左側のタブから開閉するCSSのみのトグル */
/* filterとclip-pathを同じ要素に付けるとSafariで影がclip-pathの境界に切られて消えるため、影は外側のwrapperに分離する */
.site-menu-btn-wrap {
  position: fixed;
  top: 72px;
  right: 0;
  z-index: 10;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
  transform: translateX(calc(100% - 44px));
  transition: transform 0.25s ease;
}

.site-menu-btn-wrap.is-open {
  transform: translateX(0);
}

.site-menu-btn-wrap.is-deferred {
  transform: translateX(220%);
}

.site-menu-btn-wrap.is-deferred.is-revealed {
  transform: translateX(calc(100% - 44px));
}

.site-menu-btn-wrap.is-open.is-deferred.is-revealed {
  transform: translateX(0);
}

.site-menu-btn {
  display: block;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 16% 50%, 0 0);
}

.site-menu-btn__shape {
  position: relative;
  height: 32px;
  padding: 0 22px 0 46px;
  display: flex;
  align-items: center;
  background: #f0f0ee;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 16% 50%, 0 0);
}

.site-menu-btn__icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
}

.site-menu-btn__icon span {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1px solid #bab5ac;
  background: var(--bg);
}

.site-menu-btn__icon span:nth-child(1) {
  top: 6px;
  left: 6px;
}

.site-menu-btn__icon span:nth-child(2) {
  top: 3px;
  left: 3px;
}

.site-menu-btn__icon span:nth-child(3) {
  top: 0;
  left: 0;
}

.site-menu-btn__text {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.site-menu {
  position: fixed;
  top: 90px;
  right: 0;
  z-index: 9;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  padding: 0;
}

.site-menu a {
  width: 100px;
  padding: 14px;
  background: #fdfdfc;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--muted);
}

.site-menu a:nth-child(2) {
  margin-right: 8px;
}

.site-menu a:nth-child(3) {
  margin-right: 16px;
}

.site-menu a:nth-child(4) {
  margin-right: 24px;
}

.site-menu a:nth-child(5) {
  margin-right: 32px;
}

.site-menu a + a {
  margin-top: -8px;
}

.site-menu.is-open {
  display: flex;
}

/* 表紙: 特殊な演出はやめ、通常のスクロールで流れる1画面ぶんのセクションにする */
.cover {
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.cover__title {
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  margin: 0 0 32px;
}


.cover__toc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cover__toc a {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}

/* About */
.about {
  position: relative;
  z-index: 0;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  padding: 12vh 24px;
}

.about__title {
  font-weight: 400;
  letter-spacing: 0.1em;
  margin: 24px 0 24px;
}

.about__bio {
  line-height: 1.9;
  color: var(--fg);
  margin-bottom: 32px;
}

.about__gear {
  margin-bottom: 32px;
}

.about__gear-title {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 10px;
}

.about__gear-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about__gear-list li {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.about__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about__links a {
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--fg);
  width: fit-content;
}

/* 作品一覧: テーマの章立てリスト */
.theme-list {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12vh 24px 40px;
}

/* 撮影地・機材一覧: テーマ一覧と同じ見た目だが、ページ内(.gallery内)に埋め込むためpadding無し */
.group-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.theme-list__item {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 640px;
  padding: 28px 0;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  scroll-margin-top: 80px;
}

.theme-list__cover {
  width: 96px;
  height: 96px;
  object-fit: cover;
  flex-shrink: 0;
}

.theme-list__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.theme-list__name {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.theme-list__desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* テーマ別ページ: グリッド */
.gallery {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.gallery__back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 24px;
}

.theme-switcher a,
.theme-switcher button {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0 0 2px;
  cursor: pointer;
  color: var(--muted);
}

.theme-switcher a.is-current,
.theme-switcher button.is-current {
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
}

.gallery__title {
  font-weight: 400;
  letter-spacing: 0.1em;
  margin: 0 0 32px;
}

.gallery__empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery__region {
  margin-bottom: 64px;
  padding-top: 32px;
  border-top: 1px solid #ddd;
  scroll-margin-top: 80px;
}

.gallery__region:first-of-type {
  padding-top: 0;
  border-top: none;
}

.gallery__region-title {
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  margin: 0 0 28px;
  cursor: pointer;
}

.gallery__region[open] > .gallery__region-title {
  margin-bottom: 28px;
}

.gallery__region:not([open]) > .gallery__region-title {
  margin-bottom: 0;
}

.gallery__section {
  margin-bottom: 48px;
}

.gallery__subtitle {
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.05em;
  margin: 0 0 20px;
}

.gallery__subtitle-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: fit-content;
}

.gallery__subtitle-link:hover .gallery__subtitle,
.gallery__subtitle-link:focus .gallery__subtitle {
  text-decoration: underline;
}

/* 機材ページ: カメラの下にネストするレンズ・フィルムのカードは一回り小さくする */
.group-list--compact .theme-list__item {
  max-width: 480px;
  padding: 16px 0;
  gap: 16px;
}

.group-list--compact .theme-list__cover {
  width: 64px;
  height: 64px;
}

.group-list--compact .theme-list__name {
  font-size: 1rem;
}

.journal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 640px;
}

.journal-list__item {
  padding: 24px 0;
  border-bottom: 1px solid #eee;
}

.journal-list__date {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.journal-list__text {
  margin: 0;
  line-height: 1.9;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.gallery__grid a {
  position: relative;
  display: block;
  width: 100%;
  scroll-margin-top: 80px;
}

/* 一覧へ戻った際のアンカー遷移でブラウザが自動フォーカスした時の枠を消す(キーボード操作時の:focus-visibleは残す) */
.gallery__grid a:focus:not(:focus-visible) {
  outline: none;
}

.gallery__grid a::before {
  content: '';
  display: block;
  padding-top: 100%;
}

.gallery__grid a.is-hidden {
  display: none;
}

.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 10px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.photo-frame::before,
.photo-frame::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.2));
}

.photo-frame::before {
  top: -6px;
  left: -6px;
  border-style: solid;
  border-width: 22px 22px 0 0;
  border-color: #e7e3db transparent transparent transparent;
}

.photo-frame::after {
  bottom: -6px;
  right: -6px;
  border-style: solid;
  border-width: 0 0 22px 22px;
  border-color: transparent transparent #e7e3db transparent;
}

.gallery__grid .photo-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.cover__featured {
  display: flex;
  justify-content: center;
  margin: 0 auto 32px;
  text-decoration: none;
}

.cover__featured .photo-frame {
  position: relative;
  display: inline-block;
}

.cover__featured .photo-frame img {
  width: auto;
  height: auto;
  max-width: min(70vw, 480px);
  max-height: 40vh;
}

/* 3カラム表示（PC・横画面）では枠や角の装飾が写真に対して大きく見えるため縮小 */
@media (min-width: 641px) {
  .photo-frame img {
    border-width: 6px;
  }

  .photo-frame::before,
  .photo-frame::after {
    width: 12px;
    height: 12px;
  }

  .photo-frame::before {
    top: -3px;
    left: -3px;
    border-width: 12px 12px 0 0;
  }

  .photo-frame::after {
    bottom: -3px;
    right: -3px;
    border-width: 0 0 12px 12px;
  }
}

/* WQHD以上の大きなモニタでは、文字・写真・余白が相対的に小さく見えるため拡大 */
@media (min-width: 1600px) {
  html {
    font-size: 120%;
  }

  .about {
    max-width: 600px;
  }

  .theme-list__item {
    max-width: 900px;
    gap: 32px;
    padding: 36px 0;
  }

  .theme-list__cover {
    width: 128px;
    height: 128px;
  }

  .cover__featured .photo-frame img {
    max-width: min(50vw, 620px);
    max-height: 46vh;
  }

  .cover__toc {
    gap: 20px;
  }

  .gallery {
    max-width: 1320px;
  }

  .journal-list {
    max-width: 760px;
  }

  .photo-page {
    max-width: 1300px;
  }

  .photo-page__spread {
    gap: 56px;
  }

  .photo-page__memo {
    flex-basis: 230px;
    padding: 20px 22px;
  }

  .site-mark__shape {
    height: 40px;
    padding: 0 28px 0 42px;
  }

  .site-menu-btn-wrap {
    top: 80px;
    transform: translateX(calc(100% - 52px));
  }

  .site-menu-btn-wrap.is-deferred.is-revealed {
    transform: translateX(calc(100% - 52px));
  }

  .site-menu-btn__shape {
    height: 40px;
    padding: 0 28px 0 56px;
  }

  .site-menu-btn__icon {
    left: 30px;
    width: 17px;
    height: 17px;
  }

  .site-menu-btn__icon span {
    width: 9px;
    height: 9px;
  }

  .site-menu-btn__icon span:nth-child(1) {
    top: 7px;
    left: 7px;
  }

  .site-menu-btn__icon span:nth-child(2) {
    top: 3.5px;
    left: 3.5px;
  }

  .site-menu {
    top: 106px;
  }

  .photo-frame img {
    border-width: 10px;
  }

  .photo-frame::before,
  .photo-frame::after {
    width: 20px;
    height: 20px;
  }

  .photo-frame::before {
    top: -5px;
    left: -5px;
    border-width: 20px 20px 0 0;
  }

  .photo-frame::after {
    bottom: -5px;
    right: -5px;
    border-width: 0 0 20px 20px;
  }
}

/* すべての作品ページ: 絞り込み・並び替え */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  border: 1px solid #ddd;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}

.filter-pill.is-active {
  border-color: var(--fg);
  color: var(--fg);
}

.filter-select {
  font-size: 0.8rem;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: var(--fg);
}

@media (max-width: 640px) {
  .theme-list {
    padding-top: 8vh;
  }
  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* 共通フッター: どのページからもaboutへ */
.site-footer {
  text-align: center;
  padding: 32px 24px 48px;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.site-footer a {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--muted);
}

.site-footer__copy {
  margin: 10px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.7;
}

/* 写真個別ページ */
.photo-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-page__back {
  align-self: flex-start;
  margin-bottom: 24px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
}

.photo-page__spread {
  width: 100%;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
}

.photo-page__figure {
  margin: 0;
  min-width: 0;
  display: flex;
  justify-content: center;
  flex: 1 1 auto;
}

.pswp-gallery a {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  cursor: zoom-in;
}

.photo-page__img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border: 10px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.photo-page__memo {
  position: relative;
  flex: 0 0 180px;
  padding: 14px 16px;
  background: #fdfdfc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.photo-page__memo::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.photo-page__memo-date {
  text-align: right;
  margin: 0 0 12px;
}

.photo-page__memo-date-inner {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ccc;
  font-size: 0.75rem;
  color: var(--muted);
}

.photo-page__memo-date-label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.7;
}

.photo-page__memo p {
  margin: 0 0 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8e8e3;
  font-size: 0.85rem;
  color: var(--muted);
}

.photo-page__memo a {
  text-decoration: none;
}

.photo-page__memo a:hover,
.photo-page__memo a:focus {
  color: var(--fg);
  text-decoration: underline;
}

.photo-page__memo-caption {
  color: var(--fg);
}

.photo-page__memo .photo-page__memo-caption {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
}

.photo-page__memo p:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

@media (max-width: 640px) {
  .photo-page__spread {
    flex-direction: column;
    align-items: center;
  }

  .photo-page__memo {
    flex: none;
    width: 100%;
    max-width: 320px;
    text-align: center;
  }
}

.photo-page__nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0 32px;
  margin-bottom: 32px;
  font-size: 0.85rem;
}

.photo-page__nav .photo-page__prev {
  justify-self: start;
}

.photo-page__nav .photo-page__next {
  justify-self: end;
}

.photo-page__nav-count {
  justify-self: center;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  opacity: 0.7;
}

.photo-page__nav a {
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
}
