/* ============================================================
   たら、いいな。 未来ギャラリー — style.css
   Design tokens
   色: 藍鼠 #23303A / 生成り #F3EEE4 / 潮群青 #1B4965
       潮浅葱 #6FB3D2 / 朱(鳥居) #C8433D / 棚田緑 #7C8F5E / 砂 #D8CBB0
   書体: 見出し = Shippori Mincho / 本文・UI = Zen Kaku Gothic New
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@500;700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

:root{
  --ink: #23303A;
  --paper: #F3EEE4;
  --paper-dim: #E9E2D3;
  --tide: #1B4965;
  --tide-light: #6FB3D2;
  --torii: #C8433D;
  --terrace: #7C8F5E;
  --sand: #D8CBB0;

  --font-display: "Shippori Mincho", serif;
  --font-body: "Zen Kaku Gothic New", sans-serif;

  --radius: 6px;
  --shadow-wet: 0 8px 24px -12px rgba(27, 73, 101, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
}

a { color: inherit; }

:focus-visible{
  outline: 3px solid var(--torii);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }

  /* 上のルールだとヒーロー画像が「アニメーション終了時の状態(透明度0)」で
     止まってしまい、写真が消えて見えるため、ここで明示的に上書きする */
  .hero-slide{ animation: none !important; opacity: 0 !important; }
  .hero-slide:first-child{ opacity: 1 !important; }
}

/* ---------- Header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(243,238,228,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--sand);
}

.site-header .brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--tide);
}

.site-header .brand small{
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink);
  opacity: 0.6;
}

.counter-pill{
  font-family: var(--font-body);
  font-size: 0.8rem;
  background: var(--tide);
  color: var(--paper);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.counter-pill strong{ font-size: 0.95rem; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  height: min(78vh, 640px);
  min-height: 380px;
  overflow: hidden;
  color: var(--paper);
}

.hero-slide{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: heroFade 48s infinite;
}
.hero-slide:nth-child(1){ animation-delay: 0s; }
.hero-slide:nth-child(2){ animation-delay: 6s; }
.hero-slide:nth-child(3){ animation-delay: 12s; }
.hero-slide:nth-child(4){ animation-delay: 18s; }
.hero-slide:nth-child(5){ animation-delay: 24s; }
.hero-slide:nth-child(6){ animation-delay: 30s; }
.hero-slide:nth-child(7){ animation-delay: 36s; }
.hero-slide:nth-child(8){ animation-delay: 42s; }

.hero-slide::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27,73,101,0.55) 0%, rgba(35,48,58,0.75) 100%);
  mix-blend-mode: multiply;
}

@keyframes heroFade{
  0%     { opacity: 0; }
  2.1%   { opacity: 1; }
  10.4%  { opacity: 1; }
  12.5%  { opacity: 0; }
  100%   { opacity: 0; }
}

.hero-content{
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.hero-eyebrow{
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  opacity: 0.85;
  margin-bottom: 14px;
}

.hero-title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  margin: 0;
  text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.hero-sub{
  margin-top: 14px;
  font-size: 1rem;
  opacity: 0.9;
}

.hero-cta{
  display: inline-block;
  margin-top: 28px;
  padding: 12px 32px;
  background: var(--torii);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 8px 24px -8px rgba(200, 67, 61, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hero-cta:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(200, 67, 61, 0.7);
}

/* ---------- Filter bar ---------- */
.filter-bar{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.chip-divider{
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  background: var(--sand);
  margin: 0 6px;
}

.chip{
  font-family: var(--font-body);
  font-size: 0.82rem;
  border: 1px solid var(--tide);
  color: var(--tide);
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.chip:hover{ transform: translateY(-1px); }
.chip.active{
  background: var(--torii);
  border-color: var(--torii);
  color: var(--paper);
}

/* ---------- Gallery (tide-pool masonry) ---------- */
.gallery-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.gallery{
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.gallery-col{
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 640px){
  .gallery{ gap: 8px; }
  .gallery-col{ gap: 8px; }
  .gallery-wrap{ padding: 0 8px 32px; }
  .filter-bar{ padding: 14px 8px; }
}

.card{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-dim);
  box-shadow: var(--shadow-wet);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.card:hover{ transform: translateY(-3px); }

.card img{
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.card .ribbon{
  position: absolute;
  top: 10px;
  left: -30px;
  transform: rotate(-40deg);
  background: var(--torii);
  color: var(--paper);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 3px 34px;
}

.card-overlay{
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 12px 10px;
  background: linear-gradient(180deg, rgba(35,48,58,0) 0%, rgba(35,48,58,0.85) 85%);
  color: var(--paper);
}

.card-theme{
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--tide-light);
  margin: 0 0 4px;
  font-weight: 700;
}

.card-copy{
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.card-meta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.9;
}

.like-count{ display: flex; align-items: center; gap: 4px; }

/* ---------- Lightbox ---------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(35,48,58,0.94);
  display: none;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.lightbox.open{ display: flex; }

.lightbox-inner{
  position: relative;
  max-width: 900px;
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-inner img{
  max-height: 62vh;
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-wet);
}

.lightbox-caption{
  color: var(--paper);
  text-align: center;
  margin-top: 16px;
}

.lightbox-pills{
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pill{
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(243,238,228,0.5);
  letter-spacing: 0.03em;
}

.lightbox-caption h3{
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0 0 4px;
}

.lightbox-controls{
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-btn{
  background: none;
  border: 1px solid rgba(243,238,228,0.5);
  color: var(--paper);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn:hover{ border-color: var(--paper); }

.nav-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--paper);
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 14px;
  opacity: 0.75;
}
.nav-btn:hover{ opacity: 1; }
.nav-prev{ left: -8px; }
.nav-next{ right: -8px; }

.close-btn{
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 1.6rem;
  cursor: pointer;
}

/* いいなボタン — 潮だまりの一押し (signature interaction) */
.like-btn{
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.like-btn:disabled{
  cursor: default;
  opacity: 0.7;
}

.like-btn .heart{
  font-size: 1.3rem;
  display: inline-block;
  transition: transform 0.15s ease;
}

.like-btn.liked .heart{ color: var(--torii); }

.like-btn.pulsing .heart{
  animation: heartPop 0.4s ease;
}

@keyframes heartPop{
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.ripple{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid var(--tide-light);
  pointer-events: none;
  animation: rippleOut 0.9s ease-out forwards;
}

@keyframes rippleOut{
  0%   { transform: scale(1);  opacity: 0.9; border-color: var(--torii); }
  60%  { border-color: var(--tide-light); }
  100% { transform: scale(9); opacity: 0; }
}

/* ---------- Share row ---------- */
.share-block{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.share-label{
  color: var(--paper);
  font-size: 0.8rem;
  opacity: 0.85;
  margin: 0;
}

.share-row{ display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer{
  text-align: center;
  padding: 30px 20px 50px;
  font-size: 0.78rem;
  color: var(--ink);
  opacity: 0.6;
}

/* ---------- Empty state ---------- */
.empty-state{
  text-align: center;
  padding: 60px 20px;
  color: var(--ink);
  opacity: 0.7;
  font-family: var(--font-display);
}
