/* ========================================================================
   ZASSHI PAGE - VARIABLE SYSTEM
   Defines all controllable values for this page.
   ======================================================================== */

.zasshi-page {

  /* =======================
     1. HEADING VARIABLES
     ======================= */

  --heading-scale: 0.5;                                     /* Base scale for heading text */
  --title-size: calc(3rem * var(--heading-scale));          /* Main title size */
  --subtitle-size: calc(1.4rem * var(--heading-scale));     /* Subtitle size */

  --heading-gap-subtitle: 1rem;                             /* Space between title  subtitle */
  --heading-gap-carousel: 1rem;                             /* Space between subtitle  carousel */


  /* =======================
     2. CAROUSEL VARIABLES
     ======================= */

  --carousel-width: 100%;                                   /* Carousel full width */
  --carousel-max-width: 100rem;                             /* Max width of carousel container */
  --carousel-padding-y: 5rem;                               /* Top/bottom padding of carousel block */
  --carousel-gap: 1.25rem;                                  /* Space between slides */
  --carousel-bottom-space: 2rem;                            /* Space under layout */
  --carousel-margin-top: 0rem;                              /* Extra offset above carousel (usually 0) */


  /* =======================
     3. ACTIVE/PREVIEW FRAME SIZING
     ======================= */

  --main-frame-width: 28vw;                                 /* Width of main image box (smaller) */
  --preview-frame-width: calc(var(--main-frame-width) * 0.5); /* Width of preview image box */
  --box-gap: 0.8rem;                                        /* Space between stacked boxes */
  --preview-gap: 0.85rem;                                   /* Gap between preview cards */
  --nav-size: 3rem;                                         /* Arrow button size */
  --main-image-padding: 1rem;                               /* Padding inside image box */


  /* =======================
     4. DESCRIPTION VARIABLES
     ======================= */

  --desc-max-width: 90rem;                                  /* Max width of text description area */
  --desc-padding: 2rem;                                     /* Inner padding for description block */


  /* =======================
     5. PAGE SPACING SYSTEM
     ======================= */

  --page-scale: 1;                                          /* Optional full-page zoom */
  --space-xs: 0.5rem;                                       /* Extra-small spacing */
  --space-sm: 1rem;                                         /* Small spacing */
  --space-md: 2rem;                                         /* Medium spacing */
  --space-lg: 3rem;                                         /* Large spacing */
  --space-xl: 3rem;                                         /* Extra-large spacing */

  --layout-max-width: 100rem;                               /* Max width for the whole page */
}

/* ========================================================================
   END OF VARIABLES - ACTUAL PAGE STYLING BELOW
   ======================================================================== */


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

.zasshi-page .manga-strip-buttons {
  position: relative;                                      /* Prevent nav overlapping content */
}

.content-area.zasshi-content {
  max-width: var(--layout-max-width);                      /* Center column max width */
  margin: 0 auto;                                          /* Center horizontally */
  padding: 0 var(--space-md) var(--space-lg);              /* Side + bottom spacing */
  transform: scale(var(--page-scale));                     /* Full-page zoom support */
  transform-origin: top center;                            /* Scale from top center */
  position: relative;                                      /* Anchor absolute ornaments */
}


/* ========================================================================
   CAROUSEL WRAPPER
   ======================================================================== */

.manga-carousel-container {
  width: 100vw;
  max-width: none;
  margin: 0 calc(50% - 50vw);
  padding: var(--carousel-padding-y) 0;
  text-align: center;
  overflow: visible;
}

.zasshi-carousel {
  width: 100%;
  display: flex;
  align-items: center;                                     /* arrows vertically centered to main card */
  justify-content: center;
  gap: var(--carousel-gap);
  padding: 0 var(--space-md);
  flex-wrap: nowrap;
  position: relative;
}

.zasshi-active-slot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.zasshi-preview-strip {
  position: absolute;
  top: 50%;
  left: calc(50% + (var(--main-frame-width) / 2) + var(--nav-size) + (var(--carousel-gap) * 2));
  transform: translateY(-50%);  /* ✅ THIS vertically centers it */
  display: flex;
  gap: var(--preview-gap);
  align-items: center;         /* ✅ centers the small cards vertically */
  padding: 0.5rem 0 0.5rem 0.5rem;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
}

.zasshi-nav {
  width: var(--nav-size);
  height: var(--nav-size);
  border: 1px solid #000;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  flex-shrink: 0;
}

.zasshi-nav:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}


/* ========================================================================
   HEADINGS ABOVE CAROUSEL
   ======================================================================== */

.zasshi-heading-block {
  text-align: center;                                      /* Center title + subtitle */
}

.manga-carousel-title {
  font-size: var(--title-size);                            /* Title font size */
  font-weight: 700;                                        /* Bold title */
  margin-top: 0;                                           /* NO spacing here (nav handles it) */
  margin-bottom: var(--heading-gap-subtitle);              /* Spacing before subtitle */
}

.manga-carousel-subtitle {
  font-size: var(--subtitle-size);                         /* Subtitle size */
  color: #555;                                             /* Light grey color */
  margin: 0 0 var(--heading-gap-carousel);                 /* Spacing before carousel */
}


/* ========================================================================
   CARDS INSIDE CAROUSEL
   ======================================================================== */

.zasshi-active-stack {
  width: var(--main-frame-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--box-gap);
  transition: transform 0.35s ease, opacity 0.35s ease;    /* smoother, shorter */
  transform: translateX(0);
  opacity: 1;
}

.zasshi-active-stack.from-right,
.zasshi-active-stack.from-left {
  opacity: 0;
}

.zasshi-active-stack.from-right {
  transform: translateX(40px);                             /* small slide from right */
}

.zasshi-active-stack.from-left {
  transform: translateX(-40px);                            /* small slide from left */
}

.zasshi-active-stack.is-animating {
  transform: translateX(0);
  opacity: 1;
}

.zasshi-desc-box {
  background: #000;
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  min-height: 3.4rem;
}

.zasshi-desc-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.1;
}

.zasshi-desc-range {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.zasshi-main-image-box {
  background: #fff;
  border: 1px solid #000;
  padding: var(--main-image-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--main-frame-width) * 1.2);
}

.zasshi-main-image {
  width: 100%;
  height: auto;
  max-height: calc(var(--main-frame-width) * 1.5);
  object-fit: contain;
  display: block;
}

.zasshi-button-box {
  width: 100%;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}

.zasshi-button-box span:last-child {
  font-size: 1.1rem;
}

.zasshi-preview-card {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  flex: 0 0 var(--preview-frame-width);
}

.zasshi-preview-ribbon {
  background: #000;
  color: #fff;
  padding: 0.45rem 0.6rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 2.8rem;
}

.zasshi-preview-title {
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.1;
}

.zasshi-preview-range {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.zasshi-preview-image-box {
  border: 1px solid #000;
  background: #fff;
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--preview-frame-width) * 1.3);
}

.zasshi-preview-image {
  width: 100%;
  height: auto;
  max-height: calc(var(--preview-frame-width) * 1.6);
  object-fit: contain;
  display: block;
}

.zasshi-preview-strip.slide-left {
  animation: preview-left 0.45s ease;
}

.zasshi-preview-strip.slide-right {
  animation: preview-right 0.45s ease;
}

@keyframes preview-left {
  from { transform: translateX(18%); }
  to { transform: translateX(0); }
}

@keyframes preview-right {
  from { transform: translateX(-18%); }
  to { transform: translateX(0); }
}


/* ========================================================================
   DESCRIPTION BLOCK BELOW CAROUSEL
   ======================================================================== */

.manga-description {
  max-width: var(--desc-max-width);                        /* Max text width */
  margin: var(--space-xl) auto;                            /* Center + space above/below */
  padding: var(--desc-padding);                            /* Inner padding */
  background: rgba(255,255,255,0.9);                       /* White transparent block */
  border-radius: 1rem;                                     /* Rounded corners */
  line-height: 1.6;                                        /* Comfortable reading */
  color: #333;                                             /* Dark grey text */
  font-size: calc(1.1rem * var(--heading-scale));          /* Slightly larger text */
}

.manga-description blockquote {
  padding: 1rem;                                           /* Inner spacing */
  margin: var(--space-lg) auto;                            /* Space above/below */
  background: rgba(255,255,255,0.7);                       /* Softer block */
  border-left: 5px solid #ccc;                             /* Vertical quote bar */
  max-width: 40rem;                                        /* Limit width */
  font-style: italic;                                      /* Italic quote text */
}

/* Decorative/feature image placeholder beside the description */
.zasshi-ornament {
  position: absolute;
  left: 2%;
  top: 46rem;
  width: clamp(12rem, 18vw, 16rem);
  aspect-ratio: 3 / 4;
  border: 3px dashed rgba(0, 0, 0, 0.55);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: #222;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none; /* purely decorative slot */
}

.zasshi-ornament img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 960px) {
  .zasshi-ornament {
    display: none; /* hide on smaller screens to avoid overlap */
  }
}

@media (max-width: 1100px) {
  .zasshi-carousel {
    gap: 1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 780px) {
  .zasshi-preview-strip {
    display: none;
  }

  .zasshi-page {
    --main-frame-width: 70vw;
    --preview-frame-width: calc(var(--main-frame-width) * 0.5);
    --nav-size: 2.6rem;
  }

  .zasshi-carousel {
    justify-content: center;
    gap: 0.75rem;
  }
}


/* ========================================================================
   RESPONSIVE
   ======================================================================== */

@media (max-width: 768px) {
  .zasshi-page {
    --heading-gap-carousel: 2rem;
    --desc-padding: var(--space-md);
  }
}
