/*
 * Design variants (A editorial / B cinema / C gallery).
 * Base layout lives in application.css; these files override tokens + structure.
 * Switch with ?theme=editorial|cinema|gallery (development / staff only).
 */

/* ============================================================
   Dev-only preview switcher
   ============================================================ */

.theme-switcher {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 100;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(10, 10, 14, 0.92);
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  white-space: nowrap;
}
.theme-switcher a {
  color: #bbb;
  padding: 4px 10px;
  border-radius: 999px;
}
.theme-switcher a:hover { color: #fff; background: #26262f; }
.theme-switcher a.is-current { background: #e11d48; color: #fff; }
.theme-switcher__label { color: #6b6b7a; letter-spacing: 0.16em; padding: 0 6px; font-size: 9px; }
.theme-switcher__reset { color: #6b6b7a !important; }

/* ============================================================
   A. EDITORIAL — light, sans-serif, archive magazine
   ============================================================ */

.theme-editorial {
  --bg: #f6f2ea;
  --surface: #fffdf8;
  --surface-2: #efe9dd;
  --border: #e0d7c7;
  --text: #1c1a17;
  --muted: #7a7265;
  --accent: #9f1239;
  --accent-soft: #f4dfe3;
  --radius: 3px;
  --radius-sm: 2px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.theme-editorial .site-header {
  background: rgba(246, 242, 234, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.theme-editorial .brand__name { color: #1c1a17; font-family: inherit; font-weight: 600; letter-spacing: 0.08em; }
.theme-editorial .brand__name span { color: var(--accent); }
.theme-editorial .brand__tag { color: var(--muted); letter-spacing: 0.2em; font-size: 0.62rem; }
.theme-editorial .site-nav a { color: var(--muted); border-radius: 0; font-size: 0.82rem; letter-spacing: 0.06em; }
.theme-editorial .site-nav a:hover,
.theme-editorial .site-nav a.is-active {
  color: var(--text);
  background: transparent;
  border-bottom: 1px solid var(--accent);
}
.theme-editorial .site-switch a { border-color: var(--border); color: var(--muted); border-radius: 2px; }
.theme-editorial .site-switch a.is-current { border-color: var(--accent); color: var(--accent); }
.theme-editorial .search-form input[type="search"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 2px;
}
.theme-editorial .search-form button { background: var(--text); border-radius: 2px; }
.theme-editorial .search-form button:hover { background: var(--accent); }

.theme-editorial main { padding-top: 40px; }
.theme-editorial .site-footer { border-top: 1px solid var(--border); color: var(--muted); }

.ed-wrap { display: block; }

.ed-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.ed-lead__thumb {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.ed-lead__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-lead__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  letter-spacing: 0.3em;
  font-size: 0.7rem;
}
.ed-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: var(--font);
}
.ed-lead__title {
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 16px;
}
.ed-lead__title a { color: var(--text); }
.ed-lead__title a:hover { color: var(--accent); }
.ed-lead__excerpt { color: var(--muted); font-size: 0.94rem; line-height: 1.85; margin-bottom: 18px; }
.ed-lead__meta { display: flex; gap: 12px; align-items: center; font-size: 0.72rem; color: var(--muted); font-family: var(--font); }

.ed-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  padding-top: 34px;
}
.ed-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.ed-heading--small { margin-bottom: 14px; }
.ed-heading__more { letter-spacing: 0.04em; color: var(--muted); font-size: 0.7rem; }
.ed-heading__more:hover { color: var(--accent); }

.ed-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ed-row:hover { background: rgba(0, 0, 0, 0.02); }
.ed-row__date { color: var(--muted); font-size: 0.72rem; font-family: var(--font); letter-spacing: 0.04em; }
.ed-row__title { font-size: 0.98rem; line-height: 1.7; }
.ed-row:hover .ed-row__title { color: var(--accent); }
.ed-row__kind { font-size: 0.68rem; color: var(--muted); text-align: right; font-family: var(--font); }

.ed-side__block { margin-bottom: 34px; }
.ed-years { list-style: none; margin: 0; padding: 0; }
.ed-years li a {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dotted var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
}
.ed-years li a:hover { color: var(--accent); }
.ed-years__count { color: var(--muted); font-size: 0.72rem; }

.ed-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-tag {
  font-family: var(--font);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 2px;
  background: transparent;
}
.ed-tag:hover { color: var(--accent); border-color: var(--accent); }
.ed-tag__count { margin-left: 5px; opacity: 0.6; }

/* editorial article page */
.theme-editorial .layout { display: block; }
.theme-editorial .layout > .sidebar { display: none; }
.theme-editorial .article {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  max-width: 760px;
  margin: 0 auto;
}
.theme-editorial .article__title { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.6; font-weight: 600; }
.theme-editorial .article__meta { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.theme-editorial .article-body { font-size: 1.02rem; line-height: 1.9; }
.theme-editorial .article-body img { border-radius: 0; }
.theme-editorial .article-body a { color: var(--accent); }
.theme-editorial .comments { max-width: 760px; margin-inline: auto; }
.theme-editorial .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.theme-editorial .card { background: var(--surface); border: 1px solid var(--border); border-radius: 2px; }
.theme-editorial .kind-badge { background: transparent; border-color: var(--accent); color: var(--accent); border-radius: 2px; }
.theme-editorial .tag { border-radius: 2px; background: transparent; }
.theme-editorial .btn { border-radius: 2px; }
.theme-editorial .btn--primary { background: var(--accent); border-color: var(--accent); }
.theme-editorial .alert { border-radius: 2px; }

/* ============================================================
   B. CINEMA — deep black, key art, shelves
   ============================================================ */

.theme-cinema {
  --bg: #08080a;
  --surface: #121216;
  --surface-2: #1a1a20;
  --border: #26262e;
  --text: #f1f1f4;
  --muted: #9a9aa8;
  --accent: #b91c1c;
  --accent-soft: #2a0a0a;
}

.theme-cinema .site-header { background: rgba(8, 8, 10, 0.9); border-bottom: 1px solid #1c1c22; }
.theme-cinema .brand__name { letter-spacing: 0.12em; }
.theme-cinema main { padding-top: 0; }

.ci-hero {
  position: relative;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0d0d11;
  margin-bottom: 40px;
}
.ci-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  filter: saturate(0.9);
}
.ci-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 10, 0.95) 0%, rgba(8, 8, 10, 0.65) 45%, rgba(8, 8, 10, 0.15) 100%),
    linear-gradient(0deg, rgba(8, 8, 10, 1) 0%, rgba(8, 8, 10, 0) 55%);
}
.ci-hero__body {
  position: relative;
  z-index: 2;
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
  padding: 60px 0 48px;
}
.ci-kicker {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  color: #ff5c5c;
  margin-bottom: 12px;
}
.ci-hero__title {
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1.35;
  max-width: 780px;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.ci-hero__title a { color: #fff; }
.ci-hero__excerpt { color: #cfcfd6; max-width: 620px; font-size: 0.92rem; margin-bottom: 22px; }
.ci-hero__actions { display: flex; gap: 10px; margin-bottom: 20px; }
.ci-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
}
.ci-btn:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, 0.16); }
.ci-btn--primary { background: #b91c1c; border-color: #b91c1c; }
.ci-btn--primary:hover { background: #dc2626; border-color: #dc2626; }
.ci-hero__meta { display: flex; gap: 14px; color: #9a9aa8; font-size: 0.74rem; }

.ci-shelf { width: 100vw; margin-inline: calc(50% - 50vw); margin-bottom: 34px; }
.ci-shelf__head {
  width: min(1180px, 100% - 32px);
  margin: 0 auto 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.ci-shelf__head h2 {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  margin: 0;
  color: #e7e7ec;
}
.ci-shelf__head h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: #b91c1c;
  margin-right: 10px;
  vertical-align: -0.06em;
}
.ci-shelf__more { color: var(--muted); font-size: 0.72rem; }
.ci-shelf__more:hover { color: #fff; }
.ci-shelf__body { position: relative; }
.ci-shelf__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 14px;
  scroll-padding-inline: 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
/* JS が動くときはスクロールバーを隠し、左右ボタンで操作する */
.ci-shelf.is-carousel .ci-shelf__track { scrollbar-width: none; -ms-overflow-style: none; }
.ci-shelf.is-carousel .ci-shelf__track::-webkit-scrollbar { display: none; }
.ci-shelf:not(.is-carousel) .ci-shelf__nav { display: none; }
.ci-shelf__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 10, 14, 0.72);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity 0.15s, background 0.15s;
}
.ci-shelf__nav:hover { background: rgba(40, 40, 50, 0.92); }
.ci-shelf__nav:disabled { opacity: 0; pointer-events: none; }
.ci-shelf__nav--prev { left: 8px; }
.ci-shelf__nav--next { right: 8px; }
@media (max-width: 640px) {
  .ci-shelf__nav { width: 34px; height: 34px; font-size: 1.1rem; }
  .ci-shelf__nav--prev { left: 4px; }
  .ci-shelf__nav--next { right: 4px; }
}
@media (min-width: 1212px) {
  .ci-shelf__track {
    padding-inline: calc((100vw - 1180px) / 2);
    scroll-padding-inline: calc((100vw - 1180px) / 2);
  }
}
.ci-tile {
  flex: 0 0 232px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ci-tile__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: #17171c;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #22222a;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.ci-tile:hover .ci-tile__thumb { transform: translateY(-3px) scale(1.02); border-color: #3a3a46; }
.ci-tile__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci-tile__noimg {
  display: grid;
  place-items: center;
  height: 100%;
  color: #5a5a68;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
}
.ci-tile__title {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #dcdce2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ci-tile__meta { font-size: 0.68rem; color: #7c7c8a; }

.ci-latest { margin-top: 10px; }

/* ============================================================
   C. GALLERY — masonry, image first
   ============================================================ */

.theme-gallery {
  --bg: #0f0f12;
  --surface: #16161b;
  --surface-2: #1d1d24;
  --border: #2a2a33;
  --text: #ededf1;
  --muted: #8f8f9d;
  --accent: #e11d48;
  --radius: 6px;
}
.theme-gallery main { padding-top: 26px; }

.ga-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ga-kicker { font-size: 0.64rem; letter-spacing: 0.3em; color: var(--accent); margin-bottom: 8px; }
.ga-title { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: 0.04em; }
.ga-sub { color: var(--muted); font-size: 0.82rem; margin: 0; max-width: 560px; }
.ga-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ga-chip {
  font-size: 0.74rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}
.ga-chip span { margin-left: 6px; font-size: 0.66rem; opacity: 0.6; }
.ga-chip:hover { color: var(--text); border-color: var(--accent); }

.ga-masonry { columns: 3; column-gap: 14px; }
.ga-item { display: block; break-inside: avoid; margin-bottom: 14px; }
.ga-item__media {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ga-item__media img { display: block; width: 100%; transition: transform 0.25s ease, filter 0.25s ease; }
.ga-item:hover .ga-item__media img { transform: scale(1.04); filter: brightness(0.7); }
.ga-item__noimg {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 180px;
  padding: 16px;
  color: var(--text);
  background:
    linear-gradient(160deg, rgba(225, 29, 72, 0.14), rgba(0, 0, 0, 0) 60%),
    var(--surface-2);
}
.ga-item__noimg-title { font-size: 0.86rem; line-height: 1.6; }
.ga-item__noimg-kind { font-size: 0.66rem; letter-spacing: 0.2em; color: var(--accent); }
.ga-item__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 12px 10px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ga-item:hover .ga-item__overlay { opacity: 1; }
.ga-item__title {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #fff;
  margin-bottom: 2px;
}
.ga-item__meta { display: block; font-size: 0.66rem; color: #b9b9c4; }
.ga-footer { margin-top: 26px; text-align: center; }

/* ============================================================
   Shared list pages (posts / tags / search)
   ============================================================ */

.pl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin: 8px 0 26px;
}
.pl-kicker { font-size: 0.64rem; letter-spacing: 0.3em; color: var(--accent); margin-bottom: 8px; font-family: var(--font); }
.pl-title { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: 0.02em; }
.pl-count { color: var(--muted); font-size: 0.78rem; margin: 0; }

.pl-ad { margin-bottom: 26px; max-width: 340px; }
.pl-tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-tag-cloud a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
}
.pl-tag-cloud a:hover { border-color: var(--accent); color: var(--accent); }
.pl-tag-count { color: var(--muted); font-size: 0.7rem; }

.theme-editorial .pl-title { font-size: 1.95rem; font-weight: 600; }

.theme-editorial .pl-tag-cloud a { border-radius: 2px; background: var(--surface); }
.theme-editorial .pl-ad { max-width: 300px; }

/* On the light editorial theme, captions sit under the image instead of
   appearing on hover (hover does not exist on touch devices). */
.theme-editorial .ga-item__overlay {
  position: static;
  opacity: 1;
  padding: 10px 12px 12px;
  background: none;
}
.theme-editorial .ga-item__title { color: var(--text); font-size: 0.82rem; }
.theme-editorial .ga-item:hover .ga-item__media img { transform: none; filter: none; }
.theme-editorial .ga-item__meta { color: var(--muted); }

.theme-cinema .pl-title { letter-spacing: 0.06em; }
.theme-gallery .pl-title { letter-spacing: 0.02em; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 980px) {
  .ed-lead { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ed-columns { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .ed-row { grid-template-columns: 70px minmax(0, 1fr) 48px; gap: 10px; }
  .ci-hero { min-height: 420px; }
  .ci-hero__body { padding: 40px 0 34px; }
  .ga-masonry { columns: 2; }
}

@media (max-width: 640px) {
  .brand__tag { display: none; }
  .site-switch { display: none; }
  .ed-lead__title { font-size: 1.35rem; }
  .ci-hero { min-height: 360px; }
  .ci-tile { flex-basis: 168px; }
  .ci-hero__actions { flex-wrap: wrap; }
  .ga-masonry { columns: 1; }
  .ga-item__overlay { opacity: 1; }
}
