:root {
  --bg: #111215;
  --bg-alt: #181a1f;
  --panel: #1f2229;
  --line: #303541;
  --text: #f3f4f6;
  --muted: #b1b7c4;
  --accent: #8f334f;
  --accent-soft: #b7607b;
  --max-width: 1120px;
  --narrow-width: 820px;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #101114 0%, #151821 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.8;
}

a { color: #ffd7e1; text-decoration: none; }
a:hover { color: white; }
img { max-width: 100%; display: block; }

.hero-banner {
  width: 100%;
  display: block;
  margin-bottom: 24px;
}

.container {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}
.narrow {
  width: min(calc(100% - 32px), var(--narrow-width));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(16, 17, 20, 0.84);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
}
.header-top {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}
.site-branding {
  flex: 1 1 auto;
  min-width: 0;
}
.site-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 0;
}
.site-logo-text {
  display: none;
  font-weight: 800;
}
.site-logo {
  width: clamp(96px, 10vw, 132px);
  height: auto;
  flex-shrink: 0;
}
.site-title-text {
  display: block;
  line-height: 1.2;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  white-space: nowrap;
}
.site-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.92);
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
}
.site-tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-height: 3em;
  overflow: hidden;
  transition: max-height 0.18s ease, margin 0.18s ease, opacity 0.18s ease;
}
.site-header.is-scrolled .site-tagline {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  flex: 0 0 auto;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}
.site-nav a:hover { color: white; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: white;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
}
.nav-toggle-bar {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.nav-toggle {
  position: relative;
}
.nav-toggle-bar:nth-child(1) {
  transform: translateY(-6px);
}
.nav-toggle-bar:nth-child(3) {
  transform: translateY(6px);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: rotate(-45deg);
}

.site-main { min-height: 100vh; }

.hero {
  padding: 6px 0 50px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.hero h1,
.page-header h1,
.character-hero h1 {
  margin: 0;
  line-height: 1.15;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
}
.lead {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 16px 0 0;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.button:hover {
  background: var(--accent-soft);
}
.button-secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
}
.social-links { display: inline-flex; }

.page-section {
  padding: 40px 0 72px;
}
.page-section-alt {
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.page-header {
  margin-bottom: 24px;
}
.page-title-label {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
}
.prose h2,
.prose h3 {
  margin-top: 1.7em;
  line-height: 1.3;
}
.prose p,
.prose ul { color: #dde1e8; }
.prose code {
  background: rgba(255,255,255,0.08);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.plot-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.plot-link-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.plot-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}
.plot-link-card img {
  width: 100%;
  height: auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.character-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.character-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.16);
}
.character-card-link {
  display: block;
  color: inherit;
}
.character-card-image,
.character-card-placeholder {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #292d36, #1b1e25);
}
.character-card-placeholder,
.character-detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 0.88rem;
}
.character-card-body {
  padding: 18px;
}
.character-role {
  color: var(--accent-soft);
  font-size: 0.9rem;
  margin: 0 0 6px;
  font-weight: 700;
}
.character-ruby {
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.character-ruby.large {
  font-size: 1rem;
}
.section-link {
  margin-top: 20px;
}

.character-detail {
  padding: 42px 0 72px;
}
.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
}
.character-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
}
.character-hero-media img,
.character-detail-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #292d36, #1b1e25);
  border: 1px solid rgba(255,255,255,0.08);
}
.character-meta {
  margin-top: 30px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.character-meta dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}
.character-meta dt {
  color: var(--muted);
  font-size: 0.9rem;
}
.character-meta dd {
  margin: 4px 0 0;
  font-weight: 700;
}
.character-body {
  margin-top: 28px;
}

.site-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0 40px;
}
.footer-inner {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .character-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .plot-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .header-top {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
  }
  .site-title-row {
    gap: 8px;
    flex-wrap: wrap;
  }
  .site-tagline {
    max-width: none;
    font-size: clamp(0.72rem, 2vw, 0.84rem);
    line-height: 1.35;
    letter-spacing: -0.01em;
    white-space: normal;
  }
  .site-logo {
    width: 88px;
  }
  .site-title-text {
    font-size: 1.05rem;
  }
  .site-badge {
    font-size: 0.74rem;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 10px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .site-nav.is-open {
    display: flex;
  }
  .site-nav a {
    display: block;
    width: 100%;
    padding: 10px 0;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .character-meta dl {
    grid-template-columns: 1fr;
  }
}

/* Character Pagination */
.character-pagination {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-toolbar {
  position: sticky;
  top: calc(var(--site-header-height, 96px) + 8px);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 20px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.gallery-filter {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
}

.gallery-toolbar-label {
  font-size: 0.92rem;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}

.gallery-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.gallery-toggle-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.gallery-toggle-button[aria-pressed="true"] {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
}

.gallery-sensitive-toggle {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.gallery-sensitive-toggle[aria-pressed="true"] {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
}

.gallery-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-filter-button {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.84rem;
  cursor: pointer;
}

.gallery-filter-button[aria-pressed="true"] {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
}

.gallery-card {
  margin: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.gallery-link {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

.gallery-link img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: var(--gallery-thumb-position, 50% 50%);
}

.gallery-caption {
  padding: 12px 14px 16px;
}

.gallery-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-weight: 700;
}

.gallery-sensitive-icon {
  flex: 0 0 auto;
  width: 0.9em;
  height: 0.9em;
}

.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.gallery-grid[data-gallery-view="photos"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gallery-grid[data-gallery-view="photos"] .gallery-card {
  position: relative;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 18px;
  overflow: hidden;
}

.gallery-grid[data-gallery-view="photos"] .gallery-card.sensitive::before {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 24px;
  height: 24px;
  background-image: url('../images/site/icon/sensitive/sentitiveicon.svg');
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

.gallery-grid[data-gallery-view="photos"] .gallery-link img {
  aspect-ratio: 1 / 1;
}

.gallery-grid[data-gallery-view="photos"] .gallery-caption {
  display: none;
}

.gallery-empty {
  margin: 12px 0 0;
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 34px;
}

.event-month-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.event-month-index a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6em;
  padding: 0.28rem 0.72rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.event-month-index a:hover {
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.event-month-section {
  display: grid;
  gap: 14px;
  scroll-margin-top: calc(var(--site-header-height, 96px) + 18px);
}

.event-month-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #ffffff;
  font-size: 1.15rem;
  line-height: 1.4;
}

.event-month-heading::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.event-month-list {
  display: grid;
  gap: 16px;
}

.event-empty {
  margin: 0;
  color: var(--muted);
}

.event-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.event-date {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 86px;
  border-radius: 14px;
  background: rgba(143, 51, 79, 0.18);
  border: 1px solid rgba(183, 96, 123, 0.34);
  color: #ffffff;
  line-height: 1.1;
}

.event-date-month {
  color: var(--accent-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

.event-date-month::after {
  content: '月';
  margin-left: 0.1em;
  font-size: 0.72em;
  font-weight: 700;
}

.event-date-day {
  font-size: 1.9rem;
  font-weight: 800;
}

.event-date-day::after {
  content: '日';
  margin-left: 0.1em;
  font-size: 0.45em;
  font-weight: 700;
}

.event-date--range {
  gap: 5px;
}

.event-date-range {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.08em;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.event-date-range-day:last-child::after {
  content: '日';
  margin-left: 0.1em;
  font-size: 0.45em;
  font-weight: 700;
}

.event-date-range-separator {
  color: rgba(255,255,255,0.72);
  font-size: 0.82em;
}

.event-body {
  min-width: 0;
}

.event-type {
  display: inline-flex;
  align-items: center;
  margin: 0 0 6px;
  padding: 0.18rem 0.62rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.event-title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.35;
}

.event-title a {
  color: inherit;
}

.event-title a:hover {
  color: #ffffff;
}

.event-character,
.event-description {
  margin: 6px 0 0;
}

.event-character {
  color: var(--muted);
  font-weight: 700;
}

.event-description {
  color: #dde1e8;
}

.prose .event-type {
  color: var(--accent-soft);
}

.prose .event-title {
  margin: 0;
}

.prose .event-character {
  color: var(--muted);
}

.prose .event-description {
  color: #dde1e8;
}

.fanart-note {
  margin: 0 0 24px;
  color: #dde1e8;
  line-height: 1.8;
}

.fanart-note p {
  margin: 0;
}

.fanart-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.fanart-post {
  display: flex;
  align-self: stretch;
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fanart-post .twitter-tweet {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.fanart-embed {
  display: grid;
  place-items: center;
  width: 100%;
}

.fanart-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  color: #0f1419;
  text-decoration: none;
  background: #fff;
  border: 1px solid #cfd9de;
  border-radius: 12px;
  padding: 14px;
}

.fanart-card__header {
  display: grid;
  gap: 2px;
}

.fanart-card__author {
  color: #0f1419;
  font-weight: 700;
  line-height: 1.2;
}

.fanart-card__handle,
.fanart-card__footer {
  color: #536471;
  font-size: 0.9rem;
}

.fanart-card .fanart-card__text {
  margin: 0;
  color: #0f1419;
  line-height: 1.45;
}

.fanart-card__image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #eff3f4;
}

.fanart-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.fanart-loading {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fanart-empty {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 641px) {
  .fanart-post {
    background: #fff;
    border-color: #fff;
  }
}

 

@media (max-width: 640px) {
  .fanart-list {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .fanart-post {
    align-self: start;
  }

  .gallery-toolbar,
  .gallery-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-toolbar {
    justify-content: space-between;
    border-radius: 18px;
  }

  .gallery-toolbar.is-stuck {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
  }

  .gallery-toolbar.is-stuck .gallery-toolbar-label {
    display: none;
  }

  .gallery-toolbar.is-stuck .gallery-toggle {
    flex: 1 1 auto;
    min-width: 0;
  }

  .gallery-toolbar.is-stuck .gallery-toggle-button {
    flex: 1 1 0;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .gallery-toolbar.is-stuck .gallery-sensitive-toggle {
    flex: 0 0 auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .event-card {
    grid-template-columns: 72px 1fr;
    gap: 14px;
    padding: 14px;
  }

  .event-date {
    min-height: 72px;
    border-radius: 12px;
  }

  .event-date-day {
    font-size: 1.7rem;
  }

  .event-date-range {
    font-size: 1.22rem;
  }
}

.gallery-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.gallery-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.7);
  backdrop-filter: blur(6px);
}

.gallery-modal-dialog {
  position: relative;
  width: min(90vw, 900px);
  max-height: 85vh;
  background: rgba(20, 22, 28, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.35);
  padding: 18px;
  z-index: 1;
  display: grid;
  gap: 12px;
  touch-action: pan-y;
}

.gallery-modal-media {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.gallery-modal-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.gallery-modal-actions {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-modal-alt-button,
.gallery-modal-x-link {
  min-width: 44px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.36);
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.46);
  color: rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  backdrop-filter: blur(10px);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.gallery-modal-actions [hidden] {
  display: none;
}

.gallery-modal-alt-button:hover,
.gallery-modal-alt-button[aria-pressed="true"],
.gallery-modal-x-link:hover {
  background: rgba(255,255,255,0.82);
  border-color: rgba(255,255,255,0.76);
  color: rgba(10, 12, 16, 0.92);
}

.gallery-modal-description {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 56px);
  background: linear-gradient(180deg, rgba(5, 7, 12, 0.52), rgba(5, 7, 12, 0.86));
  color: rgba(255,255,255,0.94);
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  line-height: 1.9;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-shadow: 0 2px 14px rgba(0,0,0,0.65);
  transition: opacity 0.18s ease;
  white-space: pre-wrap;
}

.gallery-modal-media.is-description-visible .gallery-modal-description {
  opacity: 1;
}

.gallery-modal-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.gallery-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.gallery-modal-prev {
  left: 12px;
}

.gallery-modal-next {
  right: 12px;
}

.gallery-modal-close:hover {
  background: rgba(255,255,255,0.16);
}

.gallery-modal-nav:hover {
  background: rgba(255,255,255,0.16);
}

@media (max-width: 640px) {
  .gallery-modal-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

.is-gallery-modal-open {
  overflow: hidden;
}

.pagination-list {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-item {
  flex: 1;
  text-align: center;
}

.pagination-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text);
  font-weight: 600;
  transition: all 0.18s ease;
}

.pagination-item a:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pagination-item.prev a {
  justify-content: flex-start;
}

.pagination-item.next a {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .pagination-list {
    flex-direction: column;
    gap: 12px;
  }

  .pagination-item {
    text-align: center;
  }

  .pagination-item a {
    justify-content: center;
  }
}



/* ここから学パロよう */

body.theme-academy {
  --bg: #f5f2ea;
  --bg-alt: #fff8ef;
  --panel: #ffffff;
  --line: #e2dccf;
  --text: #2a251f;
  --muted: #5f574c;
  --accent: #de8b3a;
  --accent-soft: #f3c78a;
  background:
    radial-gradient(circle at top right, rgba(243, 199, 138, 0.35), transparent 36%),
    linear-gradient(180deg, #fdf9f2 0%, #f5f2ea 55%, #efe7d8 100%);
}

body.theme-academy a {
  color: #9a5a20;
}

body.theme-academy .site-header {
  background: rgba(24, 54, 41, 0.92);
  border-bottom-color: rgba(255,255,255,0.14);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
}

body.theme-academy .site-nav a,
body.theme-academy .site-tagline,
body.theme-academy .lead,
body.theme-academy .prose p,
body.theme-academy .prose ul,
body.theme-academy .footer-inner {
  color: #3b342b;
}

body.theme-academy .site-header .site-title,
body.theme-academy .site-header .site-title-text,
body.theme-academy .site-header .site-tagline,
body.theme-academy .site-header .site-nav a {
  color: #f6f2e8;
}
body.theme-academy .site-logo {
  display: none;
}
body.theme-academy .site-logo-text {
  display: inline-block;
  color: #f6f2e8;
  font-family: "UD デジタル 教科書体", "UD Digi Kyokasho", "UD Digi Kyokasho NK-R",
    "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
}

body.theme-academy .page-title-label {
  background: rgba(222, 139, 58, 0.18);
  border-color: rgba(222, 139, 58, 0.38);
  color: #7b4a1a;
  box-shadow: 0 10px 24px rgba(202, 151, 90, 0.2);
}

body.theme-academy .nav-toggle,
body.theme-academy .pagination-item a,
body.theme-academy .character-card,
body.theme-academy .character-meta,
body.theme-academy .button-secondary {
  background: rgba(255,255,255,0.78);
  border-color: rgba(187, 165, 130, 0.35);
}

body.theme-academy .button {
  background: linear-gradient(135deg, #f1a24b, #e0812c);
  color: white;
}

body.theme-academy .button:hover {
  background: linear-gradient(135deg, #f6b463, #e48a3a);
}

body.theme-academy .character-card,
body.theme-academy .character-meta {
  box-shadow: 0 16px 32px rgba(155, 125, 83, 0.18);
}

body.theme-academy .character-role {
  color: #9a5a20;
}

body.theme-academy .character-card:hover,
body.theme-academy .pagination-item a:hover {
  background: rgba(255,255,255,0.92);
  border-color: rgba(187, 165, 130, 0.5);
}
