/* ======================================================
   DETAIL PAGE FINAL APP STYLE
====================================================== */

.mjv2-detail-page{
  padding-top:8px;
  background:var(--mjv2-bg);
  color:var(--mjv2-text);
}

/* ======================================================
   HERO CARD
====================================================== */

.mjv2-detail-hero-card{
  position:relative;
  margin-bottom:22px;
  padding:20px;
  border-radius:28px;
  background:
    linear-gradient(180deg, rgba(16,24,40,.96), rgba(10,16,30,.98));
  border:1px solid rgba(110,150,220,.14);
  box-shadow:
    0 16px 36px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.03);
  overflow:hidden;
}

.mjv2-detail-hero-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}

.mjv2-detail-header{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:22px;
  align-items:start;
}

.mjv2-detail-cover-wrap{
  width:100%;
}

.mjv2-detail-cover{
  position:relative;
  width:100%;
  aspect-ratio:2 / 3;
  border-radius:22px;
  overflow:hidden;
  background:#0b1018;
  border:1px solid rgba(110,150,220,.14);
  box-shadow:
    0 16px 34px rgba(0,0,0,.20),
    inset 0 1px 0 rgba(255,255,255,.03);
}

.mjv2-detail-cover::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,.03) 0%,
      rgba(255,255,255,.08) 50%,
      rgba(255,255,255,.03) 100%
    );
  animation:mjv2-detail-shimmer 1.4s linear infinite;
  pointer-events:none;
}

.mjv2-detail-cover img{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  background:var(--mjv2-image-bg);
}

@keyframes mjv2-detail-shimmer{
  0%{
    transform:translateX(-100%);
  }
  100%{
    transform:translateX(100%);
  }
}

.mjv2-detail-info{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:flex-start;
}

.mjv2-detail-heading{
  display:flex;
  flex-direction:column;
  gap:8px;
  width:100%;
}

.mjv2-detail-overline{
  font-size:11px;
  font-weight:800;
  line-height:1.2;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--mjv2-primary);
}

.mjv2-detail-title{
  margin:0;
  font-size:34px;
  font-weight:800;
  line-height:1.08;
  letter-spacing:-.025em;
  color:var(--mjv2-text);
  text-wrap:balance;
}

.mjv2-detail-alt{
  font-size:14px;
  line-height:1.55;
  color:var(--mjv2-muted);
}

/* ======================================================
   GENRES
====================================================== */

.mjv2-detail-genres{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  width:100%;
}

.mjv2-genre-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  color:var(--mjv2-text);
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  transition:
    background .16s ease,
    border-color .16s ease,
    transform .16s ease;
}

.mjv2-genre-chip:hover{
  background:rgba(255,255,255,.08);
  border-color:rgba(110,150,220,.18);
  transform:translateY(-1px);
}

/* ======================================================
   META GRID
====================================================== */

.mjv2-detail-meta-grid{
  width:100%;
  background:
    linear-gradient(180deg, rgba(14,22,38,.92), rgba(12,19,33,.96));
  border:1px solid rgba(110,150,220,.12);
  border-radius:22px;
  padding:16px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 14px;
  box-shadow:
    0 10px 24px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.02);
}

.mjv2-meta-item{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.04);
}

.mjv2-meta-label{
  font-size:11px;
  font-weight:800;
  color:var(--mjv2-muted);
  line-height:1.2;
  letter-spacing:.02em;
  text-transform:uppercase;
}

.mjv2-meta-value{
  font-size:14px;
  font-weight:700;
  line-height:1.4;
  color:var(--mjv2-text);
  word-break:break-word;
}

/* ======================================================
   ACTIONS
====================================================== */

.mjv2-detail-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  width:100%;
  margin-top:2px;
}

.mjv2-detail-main-action{
  min-width:148px;
}

/* ======================================================
   LAYOUT
====================================================== */

.mjv2-detail-content-grid{
  display:block;
}

.mjv2-detail-main{
  min-width:0;
}

/* ======================================================
   SECTION CARD BASE
====================================================== */

.mjv2-detail-section-card{
  position:relative;
  background:
    linear-gradient(180deg, rgba(16,24,40,.96), rgba(10,16,30,.98));
  border:1px solid rgba(110,150,220,.14);
  border-radius:24px;
  padding:18px;
  box-shadow:
    0 14px 32px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.03);
  overflow:hidden;
  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.mjv2-detail-section-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}

.mjv2-detail-section-card:hover{
  transform:translateY(-2px);
}

.mjv2-section-head{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.mjv2-detail-section-title{
  margin:0;
  font-size:20px;
  font-weight:800;
  line-height:1.2;
  color:var(--mjv2-text);
  letter-spacing:-.015em;
}

/* ======================================================
   SYNOPSIS
====================================================== */

.mjv2-detail-synopsis{
  margin-bottom:22px;
}

.mjv2-synopsis-content{
  position:relative;
  z-index:1;
  color:var(--mjv2-text-soft);
  overflow:hidden;
  line-height:1.72;
}

.mjv2-synopsis-content.is-collapsed{
  max-height:190px;
  position:relative;
}

.mjv2-synopsis-content.is-collapsed::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:72px;
  background:linear-gradient(to bottom, rgba(15,23,40,0), rgba(15,23,40,1));
  pointer-events:none;
}

.mjv2-synopsis-actions{
  position:relative;
  z-index:1;
  margin-top:12px;
}

/* ======================================================
   CHAPTERS
====================================================== */

.mjv2-detail-chapters{
  margin-top:0;
}

.mjv2-detail-chapters-head{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

.mjv2-detail-chapters-head-left{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.mjv2-detail-chapter-count{
  font-size:13px;
  line-height:1.4;
  color:var(--mjv2-muted);
}

/* ======================================================
   CHAPTER TOOLS
====================================================== */

.mjv2-chapter-tools{
  display:flex;
  align-items:center;
  gap:10px;
  width:min(100%, 360px);
}

.mjv2-chapter-search-wrap{
  flex:1 1 auto;
  min-width:0;
}

.mjv2-chapter-search{
  width:100%;
}

.mjv2-chapter-sort-btn{
  width:42px;
  min-width:42px;
  height:42px;
  padding:0;
  border-radius:14px;
}

.mjv2-sort-icon{
  font-size:15px;
  line-height:1;
}

/* ======================================================
   CHAPTER SCROLL BOX
====================================================== */

.mjv2-detail-chapter-card{
  position:relative;
  z-index:1;
  width:100%;
  background:
    linear-gradient(180deg, rgba(12,19,33,.90), rgba(10,16,28,.96));
  border:1px solid rgba(255,255,255,.04);
  border-radius:20px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02);
  overflow:hidden;
}

.mjv2-detail-chapter-scroll{
  max-height:520px;
  overflow-y:auto;
  padding:12px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.18) transparent;
  scroll-behavior:smooth;
  contain:content;
}

.mjv2-detail-chapter-scroll::-webkit-scrollbar{
  width:8px;
}

.mjv2-detail-chapter-scroll::-webkit-scrollbar-track{
  background:transparent;
}

.mjv2-detail-chapter-scroll::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.16);
  border-radius:999px;
}

.mjv2-detail-chapter-scroll .mjv2-chapter-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.mjv2-detail-chapter-scroll .mjv2-chapter-item{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.05);
  background:rgba(255,255,255,.03);
  color:var(--mjv2-text);
  text-decoration:none;
  transition:
    background .16s ease,
    border-color .16s ease,
    transform .16s ease,
    box-shadow .16s ease;
}

.mjv2-detail-chapter-scroll .mjv2-chapter-item:hover{
  background:rgba(255,255,255,.05);
  border-color:rgba(110,150,220,.18);
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(0,0,0,.12);
}

.mjv2-detail-chapter-scroll .mjv2-chapter-title{
  display:block;
  min-width:0;
  font-size:15px;
  font-weight:700;
  color:var(--mjv2-text);
  line-height:1.4;
}

.mjv2-detail-chapter-scroll .mjv2-chapter-date,
.mjv2-detail-chapter-scroll .mjv2-chapter-meta{
  font-size:12px;
  color:var(--mjv2-muted);
}

/* ======================================================
   FOCUS STATE
====================================================== */

.mjv2-btn:focus-visible,
.mjv2-detail-chapter-scroll .mjv2-chapter-item:focus-visible,
.mjv2-chapter-search:focus-visible{
  outline:2px solid var(--mjv2-primary);
  outline-offset:2px;
}

/* ======================================================
   TABLET
====================================================== */

@media (max-width:900px){
  .mjv2-detail-hero-card{
    padding:18px;
    border-radius:24px;
  }

  .mjv2-detail-header{
    grid-template-columns:190px minmax(0,1fr);
    gap:18px;
  }

  .mjv2-detail-title{
    font-size:29px;
  }

  .mjv2-detail-section-title{
    font-size:19px;
  }
}

/* ======================================================
   MOBILE
====================================================== */

@media (max-width:700px){
  .mjv2-detail-hero-card{
    padding:16px;
    border-radius:22px;
    margin-bottom:18px;
  }

  .mjv2-detail-header{
    grid-template-columns:1fr;
    gap:16px;
  }

  .mjv2-detail-cover-wrap{
    width:100%;
  }

  .mjv2-detail-cover{
    width:100%;
    max-width:220px;
    margin:0 auto;
  }

  .mjv2-detail-info{
    align-items:flex-start;
  }

  .mjv2-detail-title{
    font-size:26px;
  }

  .mjv2-detail-meta-grid{
    grid-template-columns:1fr 1fr;
    padding:14px;
    gap:10px 12px;
    border-radius:18px;
  }

  .mjv2-meta-value{
    font-size:13px;
  }

  .mjv2-detail-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .mjv2-detail-actions .mjv2-btn{
    width:100%;
  }

  .mjv2-detail-section-card{
    padding:16px;
    border-radius:20px;
  }

  .mjv2-detail-chapters-head{
    flex-direction:column;
    align-items:stretch;
  }

  .mjv2-chapter-tools{
    width:100%;
  }

  .mjv2-detail-chapter-scroll{
    max-height:420px;
    padding:10px;
  }

  .mjv2-synopsis-content.is-collapsed{
    max-height:170px;
  }
}

/* ======================================================
   SMALL MOBILE
====================================================== */

@media (max-width:480px){
  .mjv2-detail-page{
    padding-top:6px;
  }

  .mjv2-detail-hero-card{
    padding:14px;
    border-radius:20px;
  }

  .mjv2-detail-title{
    font-size:23px;
  }

  .mjv2-detail-alt{
    font-size:13px;
  }

  .mjv2-detail-meta-grid{
    grid-template-columns:1fr;
    padding:12px;
    gap:8px;
    border-radius:16px;
  }

  .mjv2-meta-item{
    padding:10px 11px;
    border-radius:14px;
  }

  .mjv2-detail-section-card{
    padding:14px;
    border-radius:18px;
  }

  .mjv2-detail-chapter-card{
    border-radius:16px;
  }

  .mjv2-detail-chapter-scroll{
    max-height:380px;
    padding:10px;
  }

  .mjv2-detail-chapter-scroll .mjv2-chapter-item{
    padding:13px 14px;
    border-radius:14px;
  }

  .mjv2-detail-chapter-scroll .mjv2-chapter-title{
    font-size:14px;
  }
}

/* ======================================================
   DESKTOP: synopsis full
====================================================== */

@media (min-width:901px){
  .mjv2-synopsis-content.is-collapsed{
    max-height:none;
  }

  .mjv2-synopsis-content.is-collapsed::after{
    display:none;
  }

  #mjv2-synopsis-toggle{
    display:none;
  }
}