/* ============================================================
   まちなみ今昔写真アーカイブ（トップページ） — portal.css
   色・書体は一般公開版（祇園新橋 今と昔）とそろえています
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --surface: #fdfbf7;
  --surface-2: #efe9de;
  --ink: #1f1c18;
  --ink-2: #57514a;
  --ink-3: #6f685e;
  --line: #ddd5c7;
  --accent: #8c3b2b;          /* 弁柄 */
  --accent-hover: #742e20;
  --accent-soft: #f3e3dc;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(40, 30, 20, .08), 0 8px 28px rgba(40, 30, 20, .12);
  --shadow-lift: 0 2px 4px rgba(40, 30, 20, .1), 0 14px 36px rgba(40, 30, 20, .18);
  --photo-bg: #2a2723;
  --font-sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "BIZ UDPMincho", serif;
  --radius: 14px;
  --wrap: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141311;
    --surface: #1c1a17;
    --surface-2: #24211d;
    --ink: #f0ede6;
    --ink-2: #c6c0b4;
    --ink-3: #a39c91;
    --line: #3a3630;
    --accent: #d8826a;
    --accent-hover: #e69a84;
    --accent-soft: #3a2721;
    --focus: #6aa8f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .55);
    --photo-bg: #0b0a09;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
html[lang="en"] body { line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2000; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { top: 8px; }
.noscript { margin: 24px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); }

/* ---------- ヘッダー ---------- */
.top {
  position: sticky; top: 0; z-index: 1100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 12px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; flex: 1 1 auto; }
.brand:hover { color: var(--ink); }
.mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; letter-spacing: .05em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="en"] .brand-title { font-family: var(--font-sans); letter-spacing: 0; font-weight: 650; }
.brand-sub { font-size: .74rem; color: var(--ink-3); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.nav-link {
  text-decoration: none; color: var(--ink-2); font-size: .9rem; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.lang-btn {
  margin-left: 6px; cursor: pointer; background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; font-size: .86rem; color: var(--ink-2); white-space: nowrap;
}
.lang-btn:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 860px) {
  .nav-link { display: none; }
}
@media (max-width: 520px) {
  .top-in { min-height: 56px; }
  .brand-sub { display: none; }
  .brand-title { font-size: 1rem; }
  .mark { width: 30px; height: 30px; }
}

/* ---------- トップ（紹介と今昔比較） ---------- */
.hero { padding: 56px 0 64px; background:
  radial-gradient(1200px 400px at 80% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.hero-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.eyebrow { margin: 0 0 10px; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.eyebrow:lang(ja) { letter-spacing: .2em; text-transform: none; }
.hero h1 {
  margin: 0 0 18px; font-family: var(--font-serif); font-weight: 600; letter-spacing: .06em;
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.9rem); line-height: 1.3; text-wrap: balance;
}
html[lang="en"] .hero h1 { font-family: var(--font-sans); letter-spacing: -.01em; font-weight: 700; }
.hero h1 span { display: inline-block; }   /* 「まちなみ今昔／写真アーカイブ」の区切りで改行する */
.lead { margin: 0 0 26px; font-size: 1.06rem; color: var(--ink-2); max-width: 34em; }
.hero-actions { margin: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 10px 22px; font-weight: 600;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #1a1210; } }
.local-note {
  margin: 22px 0 0; padding: 10px 14px; border-radius: 10px; font-size: .84rem; line-height: 1.6;
  background: var(--surface-2); color: var(--ink-2); border-left: 3px solid var(--accent);
}
.hero-fig { margin: 0; }
.hero-fig figcaption { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: .86rem; color: var(--ink-2); }
.hero-fig .credit { color: var(--ink-3); font-size: .8rem; }
.hero-fig .cap-link { margin-left: auto; font-weight: 600; text-decoration: none; }
.hero-fig .cap-link:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .hero { padding: 36px 0 44px; }
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .hero-fig .cap-link { margin-left: 0; flex-basis: 100%; }
}

/* 今昔比較スライダー（一般公開版と同じ仕組み） */
.cmp {
  position: relative; width: 100%; aspect-ratio: var(--ar, 1.42);
  background: var(--photo-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-touch-callout: none; -webkit-user-drag: none; }
.cmp .cmp-now { object-fit: cover; }
.cmp .cmp-old { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); pointer-events: none;
}
.cmp-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l-5 6 5 6M15 6l5 6-5 6' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 22px; background-repeat: no-repeat; background-position: center;
}
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }
.cmp:has(.cmp-range:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 3px; }
.cmp-label, .chip {
  position: absolute; top: 10px; padding: 3px 9px; border-radius: 5px; font-size: .78rem; font-weight: 650; line-height: 1.5;
  background: rgba(20, 18, 16, .74); color: #fff; pointer-events: none; letter-spacing: .03em;
}
.cmp-label.l { left: 10px; }
.cmp-label.r { right: 10px; }
.hint { margin: 8px 0 0; font-size: .8rem; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.hint svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 見出しと区切り ---------- */
.sec { padding: 64px 0; }
.sec:focus { outline: none; }
.sec-alt { background: var(--surface-2); }
.sec h2 {
  margin: 0 0 26px; font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.45rem, 1.2rem + .9vw, 1.8rem); letter-spacing: .06em;
  display: flex; align-items: center; gap: 14px;
}
.sec h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
html[lang="en"] .sec h2 { font-family: var(--font-sans); letter-spacing: 0; font-weight: 700; }
@media (max-width: 600px) { .sec { padding: 44px 0; } }

/* ---------- アーカイブのカード ---------- */
.region + .region { margin-top: 36px; }
.region-name {
  margin: 0 0 14px; font-size: .95rem; font-weight: 650; color: var(--ink-2); letter-spacing: .08em;
  display: inline-flex; align-items: center; gap: 8px;
}
.region-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.card { min-width: 0; }
.card-link {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card-link:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
a.card-link:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { .card-link { transition: none; } a.card-link:hover { transform: none; } }
.card-media { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface); aspect-ratio: 2 / 1; }
.card-media .half { position: relative; overflow: hidden; background: var(--photo-bg); }
.card-media img { width: 100%; height: 100%; object-fit: cover; -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; }
.card-media .chip { top: 8px; left: 8px; font-size: .72rem; }
.card-media.empty { display: grid; place-items: center; grid-template-columns: 1fr; background: var(--surface-2); }
.card-media.empty svg { width: 64px; height: 64px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linejoin: round; opacity: .6; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.card-title { margin: 0; font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; letter-spacing: .04em; line-height: 1.4; }
html[lang="en"] .card-title { font-family: var(--font-sans); letter-spacing: 0; font-weight: 700; font-size: 1.12rem; }
.card-meta { margin: 0; font-size: .86rem; color: var(--ink-2); }
.card-meta .dot { color: var(--ink-3); }
.card-summary { margin: 2px 0 0; font-size: .92rem; line-height: 1.7; }
.card-contents { margin: 0; font-size: .84rem; color: var(--ink-2); }
.card-holder { margin: 0; font-size: .78rem; color: var(--ink-3); }
.card-go { margin-top: auto; padding-top: 8px; align-self: flex-end; font-weight: 650; color: var(--accent); }
a.card-link:hover .card-go { color: var(--accent-hover); }
.badge { display: inline-block; vertical-align: .2em; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-family: var(--font-sans); font-size: .7rem; font-weight: 650; letter-spacing: .04em; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.card-soon { margin-top: auto; padding-top: 8px; font-size: .84rem; color: var(--ink-3); }
.is-soon .card-media img { filter: grayscale(.4); opacity: .8; }
/* アーカイブが 1 つだけのときは横長のカード */
@media (min-width: 760px) {
  .cards.single { grid-template-columns: 1fr; }
  .cards.single .card-link { flex-direction: row; }
  .cards.single .card-media { flex: 0 0 56%; aspect-ratio: auto; min-height: 300px; }
  .cards.single .card-body { padding: 28px 30px; justify-content: center; gap: 8px; }
  .cards.single .card-title { font-size: 1.55rem; }
  html[lang="en"] .cards.single .card-title { font-size: 1.35rem; }
  .cards.single .card-summary { font-size: .98rem; }
  .cards.single .card-go { margin-top: 10px; align-self: flex-start; }
}
.empty-note { color: var(--ink-2); }

/* ---------- 地図 ---------- */
.map { height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
@media (max-width: 600px) { .map { height: 320px; } }
.leaflet-container { font-family: var(--font-sans); }
.leaflet-control-attribution { font-size: 10px; }
.pin span {
  display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.pin.soon span { background: #8a847a; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { margin: 12px 16px; font-size: .9rem; line-height: 1.6; }
.pop { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.pop strong { font-size: .98rem; }
.pop span { color: #57514a; font-size: .84rem; }
.pop a { margin-top: 4px; font-weight: 650; color: #8c3b2b; text-decoration: none; }
.pop em { margin-top: 4px; font-style: normal; color: #6f685e; font-size: .84rem; }

/* ---------- このサイトについて ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; }
.about-text p { margin: 0 0 1em; }
.about-side { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.about-side h3 { margin: 0 0 4px; font-size: .9rem; font-weight: 700; color: var(--ink); }
.about-side h3:not(:first-child) { margin-top: 18px; }
.about-side p { margin: 0; color: var(--ink-2); }
.credits { margin: 0; padding-left: 1.1em; color: var(--ink-2); }
.credits li + li { margin-top: 6px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- フッター ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); font-size: .86rem; color: var(--ink-3); }
.foot-in { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; align-items: center; }
.foot-title { font-family: var(--font-serif); color: var(--ink-2); letter-spacing: .05em; }
html[lang="en"] .foot-title { font-family: var(--font-sans); letter-spacing: 0; }
