/* ============================================================
   SOCO! — ソーシャルデザイン・ギャラリー  スタイル
   ============================================================ */

:root {
  --bg:        #f7f6f3;
  --surface:   #ffffff;
  --ink:       #1f2a26;
  --ink-soft:  #5b6661;
  --ink-faint: #9aa39e;
  --line:      #e7e4dd;
  --accent:    #1f9e7a;      /* ソーシャルグッドな新緑 */
  --accent-ink:#0f6b52;
  --accent-bg: #e6f4ee;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(31,42,38,.05), 0 8px 24px rgba(31,42,38,.06);
  --shadow-hover: 0 6px 14px rgba(31,42,38,.10), 0 18px 40px rgba(31,42,38,.12);
  --maxw: 1280px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-feature-settings: "palt" 1;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.logo b {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: .04em;
  color: var(--accent-ink);
}
.logo__sub {
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .16em;
  color: var(--ink-soft);
}
.tagline {
  color: var(--ink-soft);
  font-size: .82rem;
  border-left: 1px solid var(--line);
  padding-left: 18px;
  margin: 0;
}
.tagline strong { color: var(--ink); font-weight: 600; }

/* ---------- Hero strip ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 24px 8px;
}
.hero h1 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin: 0 0 8px;
  letter-spacing: .01em;
}
.hero p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 60ch;
  font-size: .95rem;
}

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 28px;
  align-items: start;
}

/* ---------- Filters ---------- */
.filters {
  position: sticky;
  top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 22px;
  box-shadow: var(--shadow);
}
.filters__search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .9rem;
  font-family: inherit;
  background: #fafaf8;
  margin-bottom: 16px;
}
.filters__search:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.fgroup { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.fgroup:first-of-type { border-top: none; padding-top: 4px; }
.fgroup__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fgroup__title .count { color: var(--accent-ink); font-size: .72rem; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* generic pill */
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .78rem;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .14s ease;
  line-height: 1.4;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* SDGs chips（番号＋短いラベル） */
.sdg-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.sdg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 3px 10px 3px 3px;
  cursor: pointer; font-family: inherit;
  font-size: .74rem; color: var(--ink-soft);
  transition: all .14s ease; line-height: 1.3;
}
.sdg-chip__no {
  width: 19px; height: 19px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: .68rem;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.sdg-chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.sdg-chip[aria-pressed="true"] {
  border-color: var(--ink); color: var(--ink); font-weight: 700; background: #fbfbf9;
}

.clear-btn {
  margin-top: 16px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .82rem;
  padding: 9px;
  border-radius: 10px;
  cursor: pointer;
}
.clear-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.clear-btn:disabled { opacity: .4; cursor: default; }

/* ---------- Gallery ---------- */
.typetabs {
  display: inline-flex;
  gap: 4px;
  background: #eceae3;
  padding: 4px;
  border-radius: 11px;
  margin-bottom: 14px;
}
.typetab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .14s ease;
}
.typetab:hover { color: var(--ink); }
.typetab.is-active {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 1px 3px rgba(31,42,38,.12);
}

.toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar__count { font-size: .9rem; color: var(--ink-soft); }
.toolbar__count b { color: var(--ink); font-size: 1.15rem; font-weight: 800; }
.toolbar__sort {
  font-family: inherit; font-size: .82rem;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; background: #fff; color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* thumbnail (auto-generated) */
.thumb {
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb__type {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: .66rem; font-weight: 800; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.thumb__type.is-lp { background: var(--ink); color: #fff; }
.thumb__browser {
  position: absolute; top: 10px; left: 12px; right: 12px;
  height: 18px; border-radius: 6px;
  background: rgba(255,255,255,.55);
  display: flex; align-items: center; gap: 4px; padding: 0 7px;
  backdrop-filter: blur(2px);
}
.thumb__browser i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.18); }
.thumb__ph {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; padding: 16px; text-align: center;
}
.thumb__ph-emoji { font-size: 3rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.2)); line-height: 1; }
.thumb__ph-name {
  color: #fff; font-weight: 800; font-size: .92rem; letter-spacing: .02em;
  line-height: 1.35; text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.thumb__shot {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  opacity: 0; transition: opacity .45s ease; z-index: 1;
  background: #fff;
}
.thumb__shot.loaded { opacity: 1; }

.card__body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card__title { font-weight: 700; font-size: .98rem; margin: 0; }
.card__date { font-size: .72rem; color: var(--ink-faint); white-space: nowrap; }
.card__org { font-size: .76rem; color: var(--ink-soft); margin: -4px 0 0; }
.card__desc { font-size: .8rem; color: var(--ink-soft); margin: 0; line-height: 1.65; }

.card__meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 4px; }
.tag {
  font-size: .68rem;
  background: #f1efe9; color: var(--ink-soft);
  padding: 2px 8px; border-radius: 999px;
}
.card__sdgs { display: flex; gap: 4px; flex-wrap: wrap; }
.sdg-badge {
  display: inline-flex; align-items: center; gap: 3px;
  height: 18px; padding: 0 8px 0 4px; border-radius: 999px;
  color: #fff; font-size: .63rem; font-weight: 600; letter-spacing: .02em;
}
.sdg-badge b { font-weight: 800; }

/* empty state */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
}
.empty .big { font-size: 2.6rem; margin-bottom: 8px; }

/* ---------- mobile filter toggle ---------- */
.filter-toggle {
  display: none;
  margin: 0 24px 0;
  max-width: var(--maxw);
}
.filter-toggle button {
  width: 100%; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font-family: inherit;
  font-weight: 600; font-size: .9rem; cursor: pointer;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: var(--surface);
}
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  color: var(--ink-faint); font-size: .78rem;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .filter-toggle { display: block; }
  .filters {
    position: static;
    display: none;
    margin-bottom: 4px;
  }
  .filters.is-open { display: block; }
  .tagline { display: none; }
}
