/* === CSS Variables === */
:root {
  --color-bg: #f8f7f6;
  --color-white: #fff;
  --color-alt-bg: #fff5f0;
  --color-accent: #e8627c;
  --color-accent-light: rgba(232, 98, 124, 0.1);
  --color-secondary: #f0a050;
  --color-text: #333;
  --color-text-light: #555;
  --color-text-muted: #999;
  --color-border: #e5e5e5;
  --color-link: #007cff;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.13);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "ヒラギノ角ゴ W3 JIS2004", "Hiragino Kaku Gothic Pro",
               "Lato", "Noto Sans JP", sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.8;
}

/* === Layout === */
main {
  /* No max-width — sections handle their own inner width */
}

/* === Typography === */
h2 {
  font-family: "ヒラギノ角ゴ W6 JIS2004", "Hiragino Kaku Gothic Pro",
               "Montserrat", sans-serif;
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.4;
  padding-top: 16px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-top: 8px;
}

h3 {
  font-family: "ヒラギノ角ゴ W6 JIS2004", "Hiragino Kaku Gothic Pro",
               "Montserrat", sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px;
  line-height: 1.4;
}

h4 {
  font-family: "ヒラギノ角ゴ W6 JIS2004", "Hiragino Kaku Gothic Pro", sans-serif;
  font-size: 18px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 8px;
}

p {
  margin-bottom: 12px;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 12px;
}

li {
  margin-bottom: 4px;
}

/* === Hero === */
.hero {
  background-color: var(--color-bg);
  padding: 40px 0 0;
}

.hero-images {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0 48px;
}

.hero-img {
  flex: 1;
  max-width: 373px;
  height: auto;
  object-fit: contain;
}

/* === Page Navigation === */
.page-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.page-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.page-nav-inner::-webkit-scrollbar {
  display: none;
}

.page-nav a {
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.page-nav a:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  text-decoration: none;
}

/* === Section Layout (full-width backgrounds) === */
.section-full {
  padding: 48px 0;
}

.section-full:first-of-type {
  padding-top: 32px;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

.section-alt {
  background-color: var(--color-alt-bg);
}

/* === Intro === */
.intro {
  padding-top: 32px;
  padding-bottom: 16px;
}

/* === Story === */
.story h3 {
  margin-top: 0;
}

/* === Social Links === */
.social-links {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: block;
}

/* === Info Cards (Broadcasts, On-Sale, etc.) === */
.info-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-accent);
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--color-text);
}

.info-card p:last-child {
  margin-bottom: 0;
}

/* === Collab Movie Banner === */
.movie-banner {
  background: linear-gradient(135deg, var(--color-white), #fff5f5);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-accent);
}

.movie-banner h3 {
  margin-top: 0;
  font-size: 20px;
}

.movie-banner p:last-child {
  margin-bottom: 0;
}

/* === Collab Events === */
.event-main-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.event-main-card > h3:first-child {
  margin-top: 0;
  font-size: 22px;
  color: var(--color-accent);
}

.event-sub-card {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 16px 0;
}

.event-sub-card h4 {
  text-align: left;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
}

.event-sub-card ul {
  margin-bottom: 0;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 24px;
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 0;
}

.event-organizer {
  margin-top: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* === On Sale Card Grid === */
.sale-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.sale-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.sale-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.sale-card p:last-of-type {
  margin-bottom: 0;
}

/* Postcard card: text left, images right */
.postcard-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.postcard-info {
  flex: 1;
  min-width: 0;
}

.postcard-info p:last-of-type {
  margin-bottom: 0;
}

.postcard-images {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.postcard-images img {
  width: 180px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

/* === Streaming Grid === */
.streaming-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.streaming-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  height: 100px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.streaming-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

.streaming-logo img {
  width: 100%;
  max-width: 180px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

/* === Goods === */
.goods-store-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.goods-store-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.map-container {
  margin: 16px 0 0;
}

.map-container iframe {
  width: 100%;
  height: 400px;
  border: 0;
  border-radius: var(--radius-sm);
}

.online-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.online-buttons a {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
  min-height: 44px;
}

.online-buttons a:hover {
  background: #d4536c;
  transform: translateY(-1px);
  text-decoration: none;
}

/* === Character Grid with details/summary === */
.character-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.character-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.character-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.character-card img {
  display: block;
  width: 100%;
  max-width: 262px;
  height: auto;
  margin: 0 auto 8px;
}

.character-card h4 {
  margin-bottom: 4px;
  font-weight: 600;
}

.character-card details {
  text-align: left;
}

.character-card summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-accent);
  text-align: center;
  padding: 4px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  user-select: none;
}

.character-card summary::-webkit-details-marker {
  display: none;
}

.character-card summary::before {
  content: "▼ 詳細を見る";
}

.character-card details[open] summary::before {
  content: "▲ 閉じる";
}

.character-card details p {
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-top: 8px;
  margin-bottom: 0;
}

/* === Past Events — Year Groups === */
.year-group {
  margin-bottom: 8px;
}

.year-group summary {
  cursor: pointer;
  font-family: "ヒラギノ角ゴ W6 JIS2004", "Hiragino Kaku Gothic Pro",
               "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  padding: 12px 16px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  list-style: none;
  user-select: none;
  transition: background 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-group summary::-webkit-details-marker {
  display: none;
}

.year-group summary::before {
  content: "▶";
  font-size: 14px;
  color: var(--color-accent);
  transition: transform 0.2s;
  display: inline-block;
}

.year-group[open] summary::before {
  transform: rotate(90deg);
}

.year-group summary:hover {
  background: #f0efee;
}

.year-group-content {
  padding: 16px 16px 8px;
}

.year-group-content .event-item {
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-left: 3px solid var(--color-secondary);
}

.year-group-content .event-item h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
}

.year-group-content .event-item p:last-child {
  margin-bottom: 0;
}

.event-photo {
  display: block;
  max-width: 450px;
  height: auto;
  margin-top: 16px;
  border-radius: var(--radius-sm);
}

/* === Footer === */
footer {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-top: 0;
}

.footer-line {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 0 auto 20px;
  border-radius: 1px;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-social img {
  display: block;
  width: 28px;
  height: 28px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.footer-social a:hover img {
  opacity: 1;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .section-inner {
    padding: 0 32px;
  }

  .page-nav-inner {
    padding: 0 32px;
  }

  .hero-images {
    padding: 0 32px;
  }

  .streaming-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .character-grid {
    grid-template-columns: repeat(3, 1fr);
  }

}

@media (max-width: 768px) {
  .section-inner {
    padding: 0 20px;
  }

  .page-nav-inner {
    padding: 0 20px;
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }

  .hero-images {
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    gap: 8px;
  }

  .hero-img {
    max-width: 100%;
    flex: none;
  }

  h2 {
    font-size: 28px;
  }

  .streaming-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sale-grid-2col {
    grid-template-columns: 1fr;
  }

  .postcard-layout {
    flex-direction: column;
  }

  .postcard-images {
    flex-direction: column;
    align-items: center;
  }

  .postcard-images img {
    width: 100%;
    max-width: 280px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .postcard-images img {
    max-width: 100%;
  }

  .event-main-card {
    padding: 20px;
  }

  .event-sub-card {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .section-inner {
    padding: 0 16px;
  }

  .page-nav-inner {
    padding: 0 16px;
  }

  .hero-images {
    padding: 0 16px;
  }

  h2 {
    font-size: 24px;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .streaming-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .map-container iframe {
    height: 300px;
  }

  .info-card {
    padding: 16px;
  }

  .online-buttons {
    flex-direction: column;
  }

  .online-buttons a {
    justify-content: center;
  }

  .page-nav a {
    font-size: 12px;
    padding: 6px 12px;
  }
}
