/* =========================================================
   MURASU E-PAPER DEMO — E-PAPER LISTING + READER STYLES
   ========================================================= */

/* =========================================================
   PAGE BANNER (shared by epaper.html / reader.html headers)
   ========================================================= */
.page-banner{
  background: var(--ink);
  color: var(--ink-rev);
  padding: 2.5rem 0;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.page-banner::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(circle at 88% 0%, rgba(200,32,46,.35), transparent 55%);
}
.page-banner .container-x{ position:relative; z-index:1; }
.page-banner .eyebrow{ color: var(--gold); }
.page-banner h1{
  font-size: 2rem;
  font-weight: 900;
  margin: .35rem 0 .35rem;
}
.page-banner p{
  margin:0;
  color:#d8cfc2;
  font-family: var(--f-ui);
  font-size: .9rem;
  max-width: 56ch;
}

/* =========================================================
   FILTER CHIPS (decorative)
   ========================================================= */
.filter-chips{
  display:flex;
  gap:.6rem;
  flex-wrap:wrap;
  margin-bottom: 1.75rem;
}
.filter-chip{
  font-family: var(--f-ui);
  font-weight:700;
  font-size:.85rem;
  padding: .55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor:pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip.active,
.filter-chip:hover{
  background: var(--red);
  color:#fff;
  border-color: var(--red);
}
.filter-chip svg{ width:13px; height:13px; vertical-align:-2px; margin-right:.3rem; }

/* =========================================================
   EDITION GRID + CARD (epaper.html)
   ========================================================= */
.edition-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.edition-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem;
  display:flex;
  flex-direction:column;
  gap: .85rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.edition-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--line);
}
.edition-card__info{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:.5rem;
}
.edition-card__title{
  font-family: var(--f-display);
  font-weight: 800;
  font-size: .98rem;
  line-height:1.3;
}
.edition-card__meta{
  font-family: var(--f-ui);
  font-size: .72rem;
  color: var(--muted);
  white-space:nowrap;
}

/* =========================================================
   COVER-MINI — CSS-built mini front page thumbnail
   ========================================================= */
.cover-mini{
  aspect-ratio: 3/4;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap: 7px;
  overflow:hidden;
  position:relative;
}
.cover-mini__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
}
.cover-mini__brand{
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height:1;
  color: var(--ink);
}
.cover-mini__brand span{ color: var(--red); }
.cover-mini__badge{
  font-family: var(--f-ui);
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--red);
  color:#fff;
  padding: 3px 7px;
  border-radius: 3px;
  margin-top: 1px;
}
.cover-mini__meta{
  display:flex;
  justify-content:space-between;
  font-family: var(--f-ui);
  font-size: .6rem;
  color: var(--muted);
  letter-spacing: .02em;
}
.cover-mini__headline{
  font-family: var(--f-display);
  font-weight: 800;
  font-size: .8rem;
  line-height: 1.28;
  color: var(--ink);
}
.cover-mini__photo{
  flex: 1;
  min-height: 56px;
  border-radius: 2px;
  overflow:hidden;
}
.cover-mini__photo .ph-photo svg{ width:26%; height:26%; }
.cover-mini__bars{
  display:flex;
  flex-direction:column;
  gap: 4px;
}
.cover-mini__bars span{
  display:block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.cover-mini__bars span:nth-child(2){ width: 92%; }
.cover-mini__bars span:nth-child(3){ width: 76%; }

/* =========================================================
   READER SHELL
   ========================================================= */
.reader-shell{
  background: var(--bg);
  padding-bottom: 3rem;
}
.reader-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap: 1rem;
  padding: 1.5rem 0 .5rem;
}
.reader-topbar__back{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  font-family: var(--f-ui);
  font-weight:700;
  font-size:.9rem;
  color: var(--ink-soft);
  transition: color .15s;
}
.reader-topbar__back svg{ width:16px; height:16px; }
.reader-topbar__back:hover{ color: var(--red); }
.reader-topbar__title{ text-align:center; }
.reader-topbar__title h1{
  font-size: 1.35rem;
  font-weight: 900;
}
.reader-topbar__title p{
  margin: .15rem 0 0;
  font-family: var(--f-ui);
  font-size: .78rem;
  color: var(--muted);
}
.reader-topbar__actions{
  display:flex;
  gap:.5rem;
  justify-content:flex-end;
}

/* =========================================================
   BOOK STAGE
   ========================================================= */
.book-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  padding: 1.5rem 0 1rem;
  perspective: 2600px;
  position: relative;
}
.book{
  position: relative;
  width: 840px;
  height: 580px;
  transition: transform .3s ease;
}
.book.zoomed{ transform: scale(1.16); }

.page-static,
.sheet__face{
  position:absolute;
  top:0;
  width: 420px;
  height: 100%;
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.page-static--left{
  left:0;
  border-radius: 6px 0 0 6px;
  z-index: -1;
}
.page-static--right{
  left: 420px;
  border-radius: 0 6px 6px 0;
  z-index: -1;
}

.sheet{
  position:absolute;
  top:0; left:420px;
  width:420px; height:100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 1s cubic-bezier(.45,.05,.55,.95);
  transform: rotateY(0deg);
}
.sheet.no-anim{ transition: none; }
.sheet.flipped{ transform: rotateY(-180deg); }

.sheet__face{
  position:absolute; top:0; left:0;
  backface-visibility: hidden;
  overflow:hidden;
}
.sheet__front{ border-radius: 0 6px 6px 0; }
.sheet__back{
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
}
/* paper-curl shading along the spine edge of each face */
.sheet__face::after{
  content:"";
  position:absolute; inset:0;
  pointer-events:none;
}
.sheet__front::after{
  background: linear-gradient(to right, rgba(28,26,24,.14), transparent 16%);
}
.sheet__back::after{
  background: linear-gradient(to left, rgba(28,26,24,.14), transparent 16%);
}

.book-spine{
  position:absolute;
  left:50%; top:4px; bottom:4px;
  width: 16px; margin-left:-8px;
  background: linear-gradient(to right, rgba(28,26,24,.2), rgba(28,26,24,.03) 40%, rgba(28,26,24,.03) 60%, rgba(28,26,24,.2));
  z-index: 56;
  pointer-events:none;
}

.flip-zone{
  position:absolute; top:0; bottom:0;
  width: 64px;
  z-index: 70;
  cursor:pointer;
}
.flip-zone--prev{ left:0; }
.flip-zone--next{ right:0; }

/* =========================================================
   NEWSPAPER PAGE TEMPLATES ("np-" classes)
   ========================================================= */
.np-page{
  height:100%;
  padding: 18px 20px;
  font-family: var(--f-body);
  font-size: 8.5px;
  line-height: 1.55;
  color: var(--ink);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.np-masthead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.np-masthead__brand{
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}
.np-masthead__brand span{ color: var(--red); }
.np-masthead__meta{
  text-align:right;
  font-family: var(--f-ui);
  font-size: 8px;
  color: var(--muted);
  line-height: 1.7;
}
.np-masthead__meta b{ color: var(--ink); }

.np-runhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  margin-bottom: 10px;
  font-family: var(--f-ui);
  font-size: 8px;
  color: var(--muted);
  letter-spacing:.04em;
}
.np-runhead b{
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 13px;
  color: var(--ink);
}
.np-runhead b span{ color: var(--red); }

.np-page__head{
  display:flex;
  align-items:center;
  gap: 8px;
  margin: 2px 0 10px;
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
}
.np-page__head::before{
  content:"";
  display:inline-block;
  width: 18px; height:3px;
  background: var(--red);
  flex-shrink:0;
}
.np-page__head::after{
  content:"";
  flex:1;
  height:1px;
  background: var(--line);
}

.np-headline{
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 6px;
}
.np-headline--xl{ font-size: 22px; }
.np-headline--lg{ font-size: 15px; }
.np-headline--md{ font-size: 12px; }
.np-headline--sm{ font-size: 10.5px; }

.np-byline{
  font-family: var(--f-ui);
  font-size: 7px;
  font-weight:600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.np-cols{ column-count:2; column-gap: 14px; text-align:justify; hyphens:auto; }
.np-cols--3{ column-count:3; }
.np-cols p{ margin: 0 0 7px; }
.np-cols p:first-of-type::first-letter{
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 23px;
  color: var(--red);
  float:left;
  line-height: 1;
  padding-right: 3px;
  padding-top: 2px;
}

.np-photo{
  border-radius: 2px;
  overflow:hidden;
  margin-bottom: 6px;
}
.np-photo .ph-photo svg{ width:22%; height:22%; }
.np-caption{
  font-family: var(--f-ui);
  font-size: 6.5px;
  font-style: italic;
  color: var(--muted);
  margin: 2px 0 9px;
}

.np-rule{ border:none; border-top:1px solid var(--line); margin: 9px 0; }

.np-ad{
  border: 1.5px dashed var(--line);
  border-radius: 3px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  color: var(--muted);
  font-family: var(--f-ui);
  font-size: 8px;
  font-weight:700;
  text-align:center;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 10px;
}
.np-ad svg{ width:18px; height:18px; opacity:.5; }
.np-ad span{ font-size:6.5px; letter-spacing:.05em; opacity:.75; }

.np-pagefoot{
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-family: var(--f-ui);
  font-size: 7px;
  font-weight:600;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.np-grid2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np-grid3{ display:grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.np-grid3 .np-headline--sm{ font-size: 9px; }

.np-weatherbox{
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px;
  margin-bottom: 10px;
}
.np-weatherbox h4{
  font-family: var(--f-ui);
  font-size: 8px;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.np-weatherbox__row{
  display:flex;
  justify-content:space-between;
  font-family: var(--f-ui);
  font-size: 7.5px;
  color: var(--ink-soft);
  padding: 2px 0;
}
.np-weatherbox__row b{ color: var(--ink); }

.np-classified{
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
  font-size: 8px;
}
.np-classified b{ font-family: var(--f-display); font-weight:800; }

/* =========================================================
   COVER PAGE (page0)
   ========================================================= */
.np-cover{
  height:100%;
  background: linear-gradient(165deg, var(--ink) 0%, #2a2622 100%);
  color: var(--ink-rev);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 14px;
  padding: 30px;
  position:relative;
  overflow:hidden;
}
.np-cover::before{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(circle at 80% 10%, rgba(200,32,46,.35), transparent 55%);
}
.np-cover__mark{ width: 84px; height:84px; position:relative; z-index:1; }
.np-cover__brand{
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 44px;
  position:relative; z-index:1;
}
.np-cover__brand span{ color: var(--red); }
.np-cover__edition{
  font-family: var(--f-ui);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  position:relative; z-index:1;
}
.np-cover__date{
  font-family: var(--f-ui);
  font-size: 13px;
  color:#d8cfc2;
  position:relative; z-index:1;
}
.np-cover__hint{
  margin-top: 18px;
  font-family: var(--f-ui);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color:#9c9389;
  display:flex; align-items:center; gap:.4rem;
  position:relative; z-index:1;
}
.np-cover__hint svg{ width:13px; height:13px; }

/* =========================================================
   BACK COVER (right slot at final spread)
   ========================================================= */
.np-backcover{
  height:100%;
  background: linear-gradient(165deg, #2a2622 0%, var(--ink) 100%);
  color: var(--ink-rev);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 10px;
  padding: 30px;
}
.np-backcover__mark{ width:64px; height:64px; opacity:.9; }
.np-backcover h3{
  font-family: var(--f-display);
  font-weight:900;
  font-size: 18px;
}
.np-backcover p{
  font-family: var(--f-ui);
  font-size: 9px;
  color:#bcb2a3;
  max-width: 28ch;
  margin:0;
}

/* =========================================================
   READER CONTROLS
   ========================================================= */
.reader-controls{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 1.25rem;
  flex-wrap:wrap;
  margin-top: .5rem;
}
.reader-controls__btn{
  width: 46px; height:46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s;
}
.reader-controls__btn:hover:not(:disabled){
  background: var(--red); border-color: var(--red); color:#fff;
}
.reader-controls__btn:disabled{ opacity:.35; cursor:not-allowed; }
.reader-controls__btn svg{ width:18px; height:18px; }
.reader-controls__page{
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  min-width: 130px;
  text-align:center;
}

/* =========================================================
   THUMBNAIL STRIP
   ========================================================= */
.thumb-strip{
  display:flex;
  gap: .75rem;
  overflow-x:auto;
  padding: 1.25rem 0 .25rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.thumb-item{
  flex-shrink:0;
  width: 72px;
  aspect-ratio: 3/4;
  border-radius: 3px;
  border: 2px solid transparent;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor:pointer;
  overflow:hidden;
  position:relative;
  transition: border-color .15s, transform .15s;
  display:flex; flex-direction:column;
}
.thumb-item:hover{ transform: translateY(-2px); }
.thumb-item.active{ border-color: var(--red); }
.thumb-item__top{
  flex:1;
  display:flex; align-items:center; justify-content:center;
}
.thumb-item__top svg{ width:30%; height:30%; opacity:.55; }
.thumb-item__label{
  font-family: var(--f-ui);
  font-size: .58rem;
  font-weight:700;
  color: var(--ink-soft);
  text-align:center;
  padding: 3px 2px 5px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

/* =========================================================
   SINGLE-PAGE FLIP (mobile)
   ========================================================= */
@keyframes pageFlipOutNext{
  0%  { transform: perspective(1200px) rotateY(0deg); opacity:1; }
  100%{ transform: perspective(1200px) rotateY(-90deg); opacity:.15; }
}
@keyframes pageFlipInNext{
  0%  { transform: perspective(1200px) rotateY(90deg); opacity:.15; }
  100%{ transform: perspective(1200px) rotateY(0deg); opacity:1; }
}
@keyframes pageFlipOutPrev{
  0%  { transform: perspective(1200px) rotateY(0deg); opacity:1; }
  100%{ transform: perspective(1200px) rotateY(90deg); opacity:.15; }
}
@keyframes pageFlipInPrev{
  0%  { transform: perspective(1200px) rotateY(-90deg); opacity:.15; }
  100%{ transform: perspective(1200px) rotateY(0deg); opacity:1; }
}
.flip-out-next{ animation: pageFlipOutNext .35s ease-in forwards; transform-origin: left center; }
.flip-in-next { animation: pageFlipInNext  .35s ease-out forwards; transform-origin: right center; }
.flip-out-prev{ animation: pageFlipOutPrev .35s ease-in forwards; transform-origin: right center; }
.flip-in-prev { animation: pageFlipInPrev  .35s ease-out forwards; transform-origin: left center; }

/* Swipe hint overlay */
.swipe-hint{
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-family: var(--f-ui);
  font-size: .72rem;
  font-weight: 600;
  color: rgba(28,26,24,.5);
  pointer-events: none;
  animation: hintFadeOut 3.5s ease 2s forwards;
}
@keyframes hintFadeOut{
  0%  { opacity:1; }
  100%{ opacity:0; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px){
  .edition-grid{ grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 900px){
  .book-wrap{ touch-action: pan-y; }
  .book{ width: 380px; height: 524px; perspective: none; }
  .book.zoomed{ transform: scale(1.1); }
  .page-static--right, .sheet, .book-spine, .flip-zone{ display:none; }
  .page-static--left{
    width: 100%; left:0;
    border-radius: 6px;
  }
  .np-page{ font-size: 7.6px; padding: 15px 17px; }
  .np-masthead__brand{ font-size: 21px; }
  .np-runhead b{ font-size:11px; }
  .np-headline--xl{ font-size: 17px; }
  .np-headline--lg{ font-size: 13px; }
  .np-cover__brand{ font-size: 34px; }
  .np-cover__mark{ width:64px; height:64px; }
}
@media (max-width: 640px){
  .edition-grid{ grid-template-columns: 1fr; gap: 1rem; }
  .reader-topbar{ flex-direction:column; align-items:flex-start; gap:.6rem; }
  .reader-topbar__title{ text-align:left; }
  .reader-topbar__actions{ width:100%; }
}
@media (max-width: 480px){
  .edition-grid{ grid-template-columns: 1fr; gap: .75rem; }
  .book{ width: 88vw; height: calc(88vw * 1.379); }
  .reader-controls__page{ min-width:auto; font-size:.8rem; }
}
