/* MIURA SHOWCASE - Clean Final (2026-02-23)
   - TOC: details + chips (no bullets)
   - AFFINGER decorations reset (pseudo elements)
   - Uniform cards (no hero enlarge)
   - Tight spacing (image↔text gap reduced)
   - Title smaller + readable
   - Hide dates
   - Before overlay OFF
*/

/* =========================
   Base
========================= */
.miura-showcase {
  --ms-bg: #ffffff;
  --ms-text: #1f1f1f;
  --ms-text-muted: #666666;
  --ms-accent: #f1b400;
  --ms-radius: 12px;
  --ms-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --ms-shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.12);

  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--ms-text);
  line-height: 1.55;
}

.miura-showcase *,
.miura-showcase *::before,
.miura-showcase *::after {
  box-sizing: inherit;
}

/* =========================
   AFFINGER Reset (strong but safe)
========================= */
.miura-showcase h2,
.miura-showcase h3,
.miura-showcase p,
.miura-showcase figure {
  margin: 0;
  padding: 0;
}

.miura-showcase h2,
.miura-showcase h3 {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.miura-showcase h2::before,
.miura-showcase h2::after,
.miura-showcase h3::before,
.miura-showcase h3::after {
  content: none !important;
  display: none !important;
}

.miura-showcase a,
.miura-showcase a:visited {
  color: var(--ms-text) !important;
  text-decoration: none !important;
  background: transparent !important;
  border: 0 !important;
}

/* =========================
   TOC (details + chips)
========================= */
.case-toc {
  max-width: 1200px;
  margin: 8px auto 16px;
  padding: 0 16px;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fff;
}

.case-toc-summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  list-style: none;
}

.case-toc-summary::-webkit-details-marker { display: none; }

.case-toc[open] .case-toc-summary { border-bottom: 1px solid #eee; }

.case-toc-chips {
  padding: 12px 14px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-toc-chips a {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #e6e6e6;
  font-weight: 750;
  font-size: 0.92rem;
  line-height: 1.2;
}

@media (hover: hover) {
  .case-toc-chips a:hover {
    border-color: var(--ms-accent);
    color: var(--ms-accent) !important;
  }
}

/* =========================
   Section / Header
========================= */
.miura-showcase .ms-section {
  padding: clamp(20px, 3.5vw, 44px) 0;
  border-bottom: 1px solid #eee;
}

.miura-showcase .ms-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

@media (min-width: 768px) {
  .miura-showcase .ms-header {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px;
  }
}

/* Title (accent bar) */
.miura-showcase .ms-title-jp {
  position: relative;
  display: inline-block;
  padding-left: 22px !important;
  text-indent: 0 !important;
  font-weight: 900;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  letter-spacing: 0.02em;
}

.miura-showcase .ms-title-jp::before {
  content: "" !important;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 1.25em;
  border-radius: 3px;
  background: var(--ms-accent);
}

.miura-showcase .ms-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.miura-showcase .ms-title-en {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--ms-accent);
  letter-spacing: 0.12em;
}

.miura-showcase .ms-btn-view-all {
  font-weight: 800;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

@media (hover: hover) {
  .miura-showcase .ms-btn-view-all:hover {
    border-bottom-color: var(--ms-accent);
    color: var(--ms-accent) !important;
  }
}

/* =========================
   Grid (uniform)
========================= */
.miura-showcase .ms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 960px) {
  .miura-showcase .ms-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Hero is treated as regular (uniform size) */
@media (min-width: 960px) {
  .miura-showcase .ms-card--hero {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

/* =========================
   Card
========================= */
.miura-showcase .ms-card {
  background: var(--ms-bg);
  border-radius: var(--ms-radius);
  overflow: hidden;
  box-shadow: var(--ms-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) {
  .miura-showcase .ms-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ms-shadow-hover);
  }
}

.miura-showcase .ms-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  outline-offset: 4px;

  /* Swap fade: 常時transitionを持たせる（is-updating解除時も滑らかに戻る） */
  opacity: 1;
  transition: opacity 0.22s ease;
  will-change: opacity;
}

.miura-showcase .ms-card-link:focus-visible {
  outline: 2px solid var(--ms-accent);
}

/* Figure / Images */
.miura-showcase .ms-card-figure {
  position: relative;
  width: 100%;
  background: #f3f3f3;
  overflow: hidden;
}

/* uniform aspect ratio for all cards */
.miura-showcase .ms-card-figure {
  aspect-ratio: 4 / 3;
}

.miura-showcase .ms-card-figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease, opacity 0.35s ease;
}

@media (hover: hover) {
  .miura-showcase .ms-card:hover .ms-img--after { transform: scale(1.04); }
}

/* Before overlay OFF (stability + uniform look) */
.miura-showcase .ms-img--before { display: none !important; }

/* Body (tight) */
.miura-showcase .ms-card-body {
  padding: 6px 8px 8px !important;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Badges (tight) */
.miura-showcase .ms-card-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 4px !important;
  min-height: 0 !important;
  margin: 0 0 2px !important;
}

.miura-showcase .ms-badge {
  font-size: 0.68rem !important;
  padding: 1px 5px !important;
  border-radius: 6px;
  background: #f0f0f0;
  color: var(--ms-text-muted);
  line-height: 1.25;
}

.miura-showcase .ms-badge.is-empty { display: none; }

/* Title (small + remove theme padding) */
.miura-showcase .ms-card-title {
  margin: 0 !important;
  padding: 0 !important; /* important: beat theme padding */
  font-weight: 800 !important;
  font-size: clamp(0.74rem, 0.90vw, 0.84rem) !important;
  line-height: 1.28 !important;
  color: var(--ms-text) !important;

  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* Hide date block */
.miura-showcase .ms-card-meta-bottom { display: none !important; }

/* Swap fade */
.miura-showcase .ms-card.is-updating .ms-card-link {
  opacity: 0;
  pointer-events: none;
}

/* More button */
.miura-showcase .ms-more {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.miura-showcase .ms-more-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e6e6e6;
  font-weight: 850;
  font-size: 0.92rem;
}

@media (hover: hover) {
  .miura-showcase .ms-more-btn:hover {
    border-color: var(--ms-accent);
    color: var(--ms-accent) !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .miura-showcase .ms-card,
  .miura-showcase .ms-card-figure img,
  .miura-showcase .ms-card-link { transition: none !important; }
}
/* Case TOC chips: mobile 2 columns, desktop auto-fit */
.case-toc-chips{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* mobile: 2 cols */
  gap: 10px;
}
@media (min-width: 600px){
  .case-toc-chips{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* tablet/pc: smart wrap */
  }
}
.case-toc-chips a{
  width: 100%;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
