/* ============================================================================
   素材屋CNP - Shared Stylesheet
   Black & white, minimal, illustration-focused design
   ========================================================================== */

/* ============================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
  /* Text Colors */
  --text: #111;
  --text-sub: #555;
  --text-muted: #999;

  /* Background Colors */
  --bg: #fff;
  --bg-alt: #f8f8f8;

  /* Border Colors */
  --border: #e0e0e0;
  --border-light: #f0f0f0;

  /* Shadows */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.08);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;

  /* Typography */
  --font-family: 'Noto Sans JP', Inter, sans-serif;
  --font-display: 'Noto Sans JP', Inter, sans-serif;
  --line-height-tight: 1.5;
  --line-height-normal: 1.8;
  --line-height-relaxed: 1.9;
}

/* ============================================================================
   2. RESET & BASE STYLES
   ========================================================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: var(--line-height-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.02em;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 900;
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.03em;
}

h1 {
  font-size: 3.2em;
}

h2 {
  font-size: 2.6em;
}

h3 {
  font-size: 1.3em;
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-family);
  border: none;
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ============================================================================
   3. STICKY NAVIGATION (.site-nav)
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  width: 100%;
  height: 56px;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-logo {
  display: flex;
  align-items: center;
}
.nav-logo img {
  height: 24px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-links a {
  font-size: 0.88em;
  color: var(--text);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--text);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .site-nav {
    padding: 0 var(--spacing-md);
    gap: var(--spacing-md);
  }

  .nav-links {
    gap: var(--spacing-lg);
  }

  .nav-links a {
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  .site-nav {
    height: auto;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .nav-links {
    gap: var(--spacing-md);
  }

  .nav-logo img {
    height: 20px;
  }
}

/* ============================================================================
   4. PAGE HERO (.page-hero)
   ========================================================================== */

.page-hero {
  padding: 120px var(--spacing-lg);
  text-align: center;
  background-color: var(--bg);
}

.page-hero-title {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  color: var(--text);
}

.page-hero-subtitle {
  font-size: 0.95em;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
}

.page-hero-desc {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.88em;
  color: var(--text-sub);
  line-height: var(--line-height-relaxed);
}

@media (max-width: 768px) {
  .page-hero {
    padding: 80px var(--spacing-md);
  }

  .page-hero-title {
    font-size: 1.6em;
  }
}

/* ============================================================================
   5. SECTION LAYOUT (.section)
   ========================================================================== */

.section {
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.section-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section-label {
  display: inline-block;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--spacing-md);
}

.section-title {
  font-size: 1.8em;
  font-weight: 900;
  margin-bottom: var(--spacing-lg);
  color: var(--text);
}

.section-desc {
  font-size: 0.88em;
  color: var(--text-muted);
  max-width: 600px;
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-2xl);
}

@media (max-width: 768px) {
  .section {
    padding: var(--spacing-2xl) var(--spacing-md);
  }

  .section-title {
    font-size: 1.1em;
  }
}

/* ============================================================================
   6. ILLUSTRATION GRID (.illust-grid)
   ========================================================================== */

.illust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
  margin-top: var(--spacing-xl);
}

@media (max-width: 768px) {
  .illust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
  }
}

@media (max-width: 480px) {
  .illust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================================
   7. ILLUSTRATION CARD (.illust-card)
   ========================================================================== */

.illust-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.illust-card:hover {
  opacity: 0.8;
  box-shadow: var(--shadow-hover);
}

.illust-card-image {
  width: 100%;
  height: 220px;
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.illust-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.illust-card-body {
  padding: 14px 16px;
}

.illust-card-title {
  font-size: 0.82em;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
  word-break: break-word;
}

.illust-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ============================================================================
   8. SCENE CARD (.scene-card)
   ========================================================================== */

.scene-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.scene-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.scene-card-image {
  width: 100%;
  height: 180px;
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-card-body {
  padding: var(--spacing-lg);
}

.scene-card-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.scene-card-desc {
  font-size: 0.82em;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.scene-card-meta {
  font-size: 0.7em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .scene-card-image {
    height: 160px;
  }

  .scene-card-body {
    padding: var(--spacing-md);
  }
}

/* ============================================================================
   9. TAG PILLS (.tag-pill)
   ========================================================================== */

.tag-pill {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  background-color: transparent;
  color: var(--text);
  font-size: 0.7em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  background-color: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.tag-pill.active {
  background-color: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ============================================================================
   10. BUTTONS
   ========================================================================== */

.btn-primary {
  display: inline-block;
  background-color: var(--text);
  color: var(--bg);
  padding: 12px 32px;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.8;
}

.btn-outline {
  display: inline-block;
  background-color: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  padding: 12px 32px;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.btn-outline:hover {
  opacity: 0.7;
}

@media (max-width: 480px) {
  .btn-primary,
  .btn-outline {
    padding: 10px 24px;
    font-size: 0.8em;
  }
}

/* ============================================================================
   11. CONTENT AREA (.content-area)
   ========================================================================== */

.content-area {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.content-area h2 {
  font-size: 1.2em;
  font-weight: 600;
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-lg);
  color: var(--text);
}

.content-area h3 {
  font-size: 1em;
  font-weight: 500;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

.content-area p {
  font-size: 0.92em;
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-lg);
  color: var(--text-sub);
}

.content-area ul,
.content-area ol {
  list-style: none;
  margin-bottom: var(--spacing-lg);
}

.content-area li {
  font-size: 0.92em;
  line-height: var(--line-height-relaxed);
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  color: var(--text-sub);
}

.content-area li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .content-area {
    padding: var(--spacing-md);
  }

  .content-area h2 {
    font-size: 1.1em;
    margin-top: var(--spacing-xl);
  }
}

/* ============================================================================
   12. CHARACTER CARD (.char-card)
   ========================================================================== */

.char-card {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
  padding: var(--spacing-lg);
  background-color: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: var(--spacing-lg);
}

.char-card-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.char-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.char-card-body {
  flex: 1;
}

.char-card-name {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.char-card-desc {
  font-size: 0.85em;
  color: var(--text-muted);
  line-height: var(--line-height-normal);
}

@media (max-width: 768px) {
  .char-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .char-card-image {
    width: 100px;
    height: 100px;
  }
}

/* ============================================================================
   13. FOOTER
   ========================================================================== */

footer {
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding: var(--spacing-2xl) var(--spacing-lg);
  text-align: center;
}

footer p {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

footer a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--text);
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}

footer .footer-links a {
  font-size: 0.78em;
}

@media (max-width: 768px) {
  footer {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  footer .footer-links {
    gap: var(--spacing-md);
  }
}

/* ============================================================================
   14. BREADCRUMB (.breadcrumb)
   ========================================================================== */

.breadcrumb {
  font-size: 0.78em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.breadcrumb a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  margin: 0 8px;
  color: var(--text-muted);
}

/* ============================================================================
   15. DETAIL MODAL
   ========================================================================== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background-color: var(--bg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  background-color: var(--bg);
  border: none;
  padding: var(--spacing-md);
  cursor: pointer;
  font-size: 1.2em;
  color: var(--text);
  z-index: 1001;
  float: right;
}

.modal-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl);
}

.modal-image {
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  overflow: hidden;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.modal-meta {
  font-size: 0.88em;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.modal-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: auto;
}

.modal-section {
  padding: var(--spacing-xl);
  border-top: 1px solid var(--border);
}

.modal-section-title {
  font-size: 1em;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
}

.modal-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2px;
}

@media (max-width: 768px) {
  .modal-header {
    grid-template-columns: 1fr;
  }

  .modal-image {
    min-height: 300px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================================
   16. UTILITY CLASSES
   ========================================================================== */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

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

.text-muted {
  color: var(--text-muted);
}

.mt-xs {
  margin-top: var(--spacing-xs);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mt-xl {
  margin-top: var(--spacing-xl);
}

.mt-2xl {
  margin-top: var(--spacing-2xl);
}

.mb-xs {
  margin-bottom: var(--spacing-xs);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mb-xl {
  margin-bottom: var(--spacing-xl);
}

.mb-2xl {
  margin-bottom: var(--spacing-2xl);
}

.px-lg {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

.py-lg {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   17. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--spacing-md);
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  h1,
  .page-hero-title {
    font-size: 1.4em;
  }

  h2 {
    font-size: 1.1em;
  }

  h3 {
    font-size: 0.95em;
  }
}

/* ============================================================================
   End of Stylesheet
   ========================================================================== */
