:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --text: #f2f3f5;
  --muted: #a7adbb;
  --border: rgba(255,255,255,0.10);
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 18px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1000px 500px at 30% -10%, rgba(114,137,218,0.20), transparent 55%),
    radial-gradient(900px 400px at 80% -10%, rgba(46,204,113,0.16), transparent 60%),
    var(--bg);
  color: var(--text);
}

.wrap {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11,12,16,0.65);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap { padding: 18px 0; }

.site-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
}

/* ---------- Cover ---------- */
.cover { margin: 18px 0 22px; }

.cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Gallery ---------- */
.gallery {
  display: flex;
  flex-direction: column;
  align-items: center; /* center cards */
  gap: 52px;
  padding-bottom: 30px;
}

/* ---------- Card (SHRINK-WRAP FIX) ---------- */
.card {
  display: inline-block;      /* 🔑 key fix */
  background: rgba(17,19,26,0.70);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ---------- Image ---------- */
.image-slot img {
  display: block;
  max-width: 100%;
  height: auto;
  background: #0f1117;
}

/* Desktop: constrain height, keep width natural */
@media (min-width: 900px) {
  .image-slot img {
    max-height: 80vh;
    width: auto;
    margin: 0 auto;
  }
}

/* ---------- Caption (EXACT SAME WIDTH AS IMAGE) ---------- */
.description {
  margin: 0;
  padding: 22px 18px 32px;
  font-size: 15px;
  line-height: 1.7;

  background: #ffffff;
  color: #000000;

  border-top: 1px solid rgba(0,0,0,0.1);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);

  text-align: center; /* PC + mobile */
}

/* Hide empty captions */
.description:empty { display: none; }

/* ---------- Divider ---------- */
.divider {
  text-align: center;
  font-size: clamp(32px, 6vw, 56px);
  color: var(--muted);
  margin: 28px 0 24px;
}

/* ---------- Footer ---------- */
.footer {
  color: var(--muted);
  padding: 18px 0 30px;
  text-align: center;
  border-top: 1px solid var(--border);
}