/* =========================================================
   CHUM「コラボTシャツ 100の出会い」
   Design tokens are shared with the news / menu sites.
   ========================================================= */
:root {
  --cream:  #F5F0E8;
  --brown:  #2C1F1A;
  --crimson:#8B2D2D;
  --gold:   #B8923D;

  --line:   rgba(44, 31, 26, 0.10);   /* faint grid line */
  --cream-2:#EFE7DA;

  --serif:  "Noto Serif JP", "Cormorant Garamond", serif;
  --garamond:"Cormorant Garamond", "Noto Serif JP", serif;
  --sans:   "Noto Sans JP", system-ui, sans-serif;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--brown);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

/* ===================== Header ===================== */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand__mark { width: 48px; height: 48px; object-fit: contain; }
.brand__words { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--garamond);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand__sub {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .34em;
  color: var(--gold);
  margin-top: 4px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: .82rem;
  letter-spacing: .14em;
}
.site-nav a { text-decoration: none; transition: color .2s; }
.site-nav a:hover { color: var(--crimson); }
.site-nav__btn {
  background: var(--crimson);
  color: var(--cream) !important;
  padding: 8px 16px;
  border-radius: 999px;
  letter-spacing: .12em;
}
.site-nav__btn:hover { background: #762424; }

/* ===================== Intro ===================== */
.intro {
  position: relative;
  max-width: var(--maxw);
  margin: 18px auto 6px;
  padding: 12px 22px 0;
  text-align: center;
}
.intro__counter {
  position: absolute;
  top: 0;
  right: 22px;
  font-family: var(--garamond);
  font-size: .9rem;
  letter-spacing: .14em;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 4px 14px;
  background: var(--cream);
}
.intro__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.6vw, 3rem);
  margin: 26px 0 10px;
  letter-spacing: .04em;
}
.intro__title .accent { color: var(--crimson); }
.intro__lead {
  font-size: clamp(.92rem, 2vw, 1.05rem);
  color: #5b4a40;
  margin: 0 auto;
  max-width: 36em;
}

/* ===================== Filter bar ===================== */
.filterbar {
  max-width: var(--maxw);
  margin: 26px auto 10px;
  padding: 0 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}
.filterbar__toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.mode-btn {
  font-family: var(--sans);
  font-size: .76rem;
  letter-spacing: .1em;
  border: 0;
  background: transparent;
  color: var(--brown);
  padding: 7px 14px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.mode-btn.is-active { background: var(--brown); color: var(--cream); }

.filterbar__rows { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.letter-btn {
  font-family: var(--serif);
  font-size: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--brown);
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.letter-btn:hover { border-color: var(--gold); transform: translateY(-2px); }
.letter-btn.is-active { background: var(--gold); color: var(--cream); border-color: var(--gold); }

.filter-all {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .08em;
  border: 1px solid var(--crimson);
  color: var(--crimson);
  background: var(--cream);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.filter-all.is-active,
.filter-all:hover { background: var(--crimson); color: var(--cream); }

/* ===================== Grid ===================== */
.grid {
  max-width: var(--maxw);
  margin: 14px auto 60px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);  /* PC ~10 cols */
  /* faint methodical grid lines */
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(7, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
}
.cell--empty { background: transparent; }

.cell__shirt {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 18%;
  will-change: transform;
  transition: opacity .4s ease, filter .4s ease, transform .4s ease;
}

/* collaborated cells are interactive */
.cell--collab { cursor: pointer; }
.cell--collab .cell__shirt:hover { filter: drop-shadow(0 6px 10px rgba(44,31,26,.22)); }

/* ---- sway animation ---- */
@keyframes sway {
  0%   { transform: rotate(-2.4deg) translateY(0); }
  50%  { transform: rotate(2.6deg)  translateY(-4px); }
  100% { transform: rotate(-2.4deg) translateY(0); }
}
.cell--shirt .cell__shirt {
  animation-name: sway;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

/* ---- filter states ---- */
.grid.is-filtering .cell__shirt { opacity: .2; filter: grayscale(.6); transform: scale(.96); }
.grid.is-filtering .cell--empty { opacity: .2; }
.grid.is-filtering .cell.is-match .cell__shirt {
  opacity: 1;
  filter: drop-shadow(0 0 14px rgba(184, 146, 61, .85));
  transform: scale(1.1) translateY(-6px);
  z-index: 3;
}
.cell.is-match { z-index: 3; }

/* ---- hover mini-card (PC) ---- */
.cell__card {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 6px);
  width: max(150px, 100%);
  background: var(--brown);
  color: var(--cream);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .72rem;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 6;
  box-shadow: 0 8px 22px rgba(44,31,26,.3);
}
.cell__card strong { display: block; font-family: var(--serif); font-size: .82rem; margin-bottom: 2px; }
.cell__card .go { color: var(--gold); display: inline-block; margin-top: 6px; letter-spacing: .04em; }
.cell--collab:hover .cell__card { opacity: 1; transform: translate(-50%, -4px); }

/* ===================== Detail overlay ===================== */
.detail { position: fixed; inset: 0; z-index: 50; display: flex; }
.detail[hidden] { display: none; }
.detail__backdrop { position: absolute; inset: 0; background: rgba(44,31,26,.55); backdrop-filter: blur(2px); }
.detail__panel {
  position: relative;
  margin: auto;
  width: min(760px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: 16px;
  padding: 40px clamp(22px, 5vw, 48px);
  box-shadow: 0 24px 60px rgba(44,31,26,.4);
  animation: panel-in .35s ease;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.detail__close {
  position: absolute;
  top: 14px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--brown);
}
.detail__close:hover { background: var(--cream-2); }

.detail__hero { width: 100%; border-radius: 12px; margin-bottom: 14px; background: var(--cream-2); }
.detail__gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.detail__gallery img {
  width: calc(50% - 5px);
  border-radius: 10px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: var(--cream-2);
}
.detail__name { font-family: var(--serif); font-weight: 700; font-size: clamp(1.4rem, 3.6vw, 2rem); margin: 6px 0 2px; }
.detail__brand { color: var(--gold); font-size: 1rem; letter-spacing: .06em; margin: 0 0 18px; }
.detail__h { font-family: var(--serif); font-size: .95rem; color: var(--crimson); margin: 22px 0 6px; letter-spacing: .06em; }
.detail__text { margin: 0; color: #4a3b33; }
.detail__links { margin: 24px 0 4px; display: flex; flex-wrap: wrap; gap: 12px; }
.detail__links a {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .82rem;
  transition: background .2s, color .2s;
}
.detail__links a:hover { background: var(--gold); color: var(--cream); }
.detail__back {
  display: inline-block;
  margin-top: 26px;
  font-size: .88rem;
  color: var(--crimson);
  text-decoration: none;
}
.detail__back:hover { text-decoration: underline; }

/* ===================== Footer ===================== */
.site-footer {
  text-align: center;
  padding: 56px 22px 48px;
  background: var(--cream-2);
  border-top: 1px solid var(--line);
}
.site-footer__thanks {
  font-family: var(--garamond);
  font-size: 2.2rem;
  color: var(--crimson);
  margin: 0 0 4px;
  transform: rotate(-3deg);
}
.site-footer__bird { font-size: 1.6rem; margin: 0 0 10px; color: var(--brown); }
.site-footer__msg { margin: 0 0 22px; color: #5b4a40; }
.site-footer__mark { margin: 0 auto 18px; width: 56px; height: 56px; object-fit: contain; }
.site-footer__legal {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
  font-size: .74rem; letter-spacing: .08em; color: #6b5a50; margin: 0;
}
.site-footer__legal a { text-decoration: none; }
.site-footer__legal a:hover { color: var(--crimson); }

/* ===================== Header / intro responsive ===================== */
@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    padding: 14px 18px;
  }
  .site-nav { gap: 14px; font-size: .72rem; letter-spacing: .08em; }
  .site-nav__btn { padding: 6px 12px; }

  .intro { margin-top: 8px; }
  .intro__counter {
    position: static;
    display: inline-block;
    margin: 0 auto 10px;
  }
  .intro__title { margin-top: 6px; }
}

@media (max-width: 400px) {
  .site-nav { gap: 10px; font-size: .66rem; }
  .brand__name { font-size: 1.35rem; }
}

/* ===================== Reduced motion ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cell--shirt .cell__shirt { animation: none !important; }
  .detail__panel { animation: none; }
}
