/*
 * Gallery page styles for Hiroshi Tanita Photography
 * Converted verbatim from "Gallery Prototype.dc.html" (Claude Design).
 * All colour / size / transition values are unchanged from the prototype.
 * Class prefix: g- (shared header/nav/mobile-menu/footer chrome lives in
 * css/site-chrome.css under the site-/is- prefixes).
 */

/* prototype @keyframes gfadeA/gfadeB were unused in the render;
   entrance/FLIP motion is done via the Web Animations API in JS. */

/* ---- main layout ---- */
.g-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 44px);
  padding: clamp(28px, 4.5vw, 44px) clamp(20px, 4.5vw, 48px);
  align-items: start;
}

/* ---- sidebar / filters ---- */
.g-filters {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.g-title {
  color: var(--c-light);
  font-weight: 300;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: .38em;
}

.g-count {
  color: rgba(var(--c-light-rgb), .55);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 11px;
  margin-top: 6px;
  letter-spacing: .14em;
}

.g-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(var(--c-light-rgb), .35);
  padding: 0;
}

.g-search input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--c-light);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.g-search input::placeholder {
  color: rgba(var(--c-light-rgb), .4);
}

.g-group-label {
  color: rgba(var(--c-light-rgb), .6);
  font-size: 10px;
  letter-spacing: .28em;
  margin-bottom: 12px;
}

.g-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

/* base chip造形 (prototype). state colours set inline via JS-driven modifiers. */
.g-chip {
  border: 1px solid rgba(var(--c-light-rgb), .4);
  background: transparent;
  color: rgba(var(--c-light-rgb), .85);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background .35s, color .35s, border-color .35s;
}

/* THEME chips use slightly tighter tracking + padding in the prototype */
.g-chip.g-chip-theme {
  letter-spacing: .1em;
  padding: 7px 13px;
}

.g-chip:hover {
  border-color: rgba(var(--c-light-rgb), .95);
}

.g-chip.g-on {
  border-color: var(--c-light);
  background: var(--c-light);
  color: var(--c-ink);
}

.g-clear {
  color: rgba(var(--c-light-rgb), .6);
  font-size: 10px;
  letter-spacing: .18em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
}

.g-clear:hover {
  color: var(--c-white);
}

/* ---- geo search (地名→半径30km, 小型版 .g-search) ---- */
.g-geo-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.g-geo-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid rgba(var(--c-light-rgb), .35);
  outline: none;
  color: var(--c-light);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 12px;
  padding: 9px 12px;
  box-sizing: border-box;
}

.g-geo-search input::placeholder {
  color: rgba(var(--c-light-rgb), .4);
}

.g-geo-search button {
  flex: none;
  border: 1px solid rgba(var(--c-light-rgb), .4);
  background: transparent;
  color: rgba(var(--c-light-rgb), .85);
  font-family: var(--font-jp);
  font-size: 10px;
  letter-spacing: .14em;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .35s, color .35s, border-color .35s;
}

.g-geo-search button:hover:not(:disabled) {
  border-color: rgba(var(--c-light-rgb), .95);
}

.g-geo-search button:disabled {
  opacity: .5;
  cursor: default;
}

.g-geo-error {
  color: rgba(var(--c-light-rgb), .6);
  font-size: 10px;
  letter-spacing: .06em;
  margin-bottom: 12px;
}

.g-geo-chip-wrap:not(:empty) {
  margin-bottom: 12px;
}

/* ---- location map (MapLibre GL, white frame — same idiom as .w-map-frame) ---- */
.g-map-wrap {
  position: relative;
}

.g-map-frame {
  background: var(--c-white);
  padding: 8px;
  box-shadow: 0 5px 22px rgba(0, 0, 0, .28);
}

.g-map {
  position: relative;
  height: 285px; /* 2026-07-08 谷田さん指示で1.5倍 */
  overflow: hidden;
}

/* .g-spot is the element of a maplibregl.Marker, which handles positioning;
   the spot itself only lays out its ring + label. */
.g-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.g-spot.g-spot-empty {
  cursor: default;
}

.g-spot-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-light-rgb), .6);
  background: rgba(38, 38, 37, .72);
  color: var(--c-light);
  font-size: 11px;
  letter-spacing: .04em;
  transition: background .35s, color .35s, border-color .35s,
    transform .45s var(--ease-out);
}

.g-spot:not(.g-spot-empty) .g-spot-ring:hover {
  transform: scale(1.12);
  border-color: var(--c-light);
}

.g-spot-empty .g-spot-ring {
  border-color: rgba(var(--c-light-rgb), .25);
  background: transparent;
  color: rgba(var(--c-light-rgb), .35);
}

.g-spot-on .g-spot-ring {
  border-color: var(--c-light);
  background: var(--c-light);
  color: var(--c-ink);
}

.g-spot-label {
  color: rgba(var(--c-light-rgb), .75);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 9px;
  letter-spacing: .16em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
  white-space: nowrap;
}

/* ---- grid ---- */
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: clamp(24px, 3vw, 38px);
}

.g-tile {
  text-decoration: none;
  display: block;
}

.g-tile-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
  transition: transform .6s var(--ease-out), box-shadow .6s;
}

.g-tile:hover .g-tile-frame {
  transform: scale(1.02);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .5);
}

.g-tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease-out);
}

.g-tile:hover .g-tile-img {
  transform: scale(1.05);
}

.g-tile-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
}

.g-tile-title {
  color: rgba(var(--c-light-rgb), .88);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 13px;
}

.g-tile-num {
  color: rgba(var(--c-light-rgb), .35);
  font-size: 9px;
  letter-spacing: .2em;
}

.g-tile-sub {
  color: rgba(var(--c-light-rgb), .45);
  font-size: 9.5px;
  letter-spacing: .18em;
  margin-top: 4px;
}

.g-sentinel {
  width: 100%;
  height: 1px;
}

.g-no-results {
  color: rgba(var(--c-light-rgb), .6);
  font-family: var(--font-jp);
  font-weight: 300;
  font-size: 13px;
  padding: 48px 0;
  text-align: center;
  letter-spacing: .1em;
}

/* ---- responsive: >=900px is the desktop layout ---- */
@media (min-width: 900px) {
  .g-main {
    grid-template-columns: 230px 1fr;
  }
}

/* ---- reduced motion: JS also disables entrance/FLIP animations ---- */
@media (prefers-reduced-motion: reduce) {
  .g-tile-frame,
  .g-tile-img,
  .g-chip,
  .g-spot-ring {
    transition: none;
  }
}
