@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=UnifrakturMaguntia&display=swap');

/* DÉCOS CÔTÉS */
.mag-deco {
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 5;
}

.mag-deco-left { left: 20px; }
.mag-deco-right { right: 20px; align-items: flex-end; }

.mag-sticker {
  position: absolute;
  font-size: 1.6rem;
  user-select: none;
  filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.2));
}

/* WRAPPER */
.magazine-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 10;
  margin: 0 auto;
}

/* SCÈNE 3D */
.mag-scene {
  perspective: 2000px;
  position: relative;
  height: 72vh;
  width: calc(72vh * 2 / 1.4142);
  transform-style: preserve-3d;
}

/* Spread = les deux pages côte à côte */
.mag-spread-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
}

/* Couverture = page simple centrée */
.mag-scene.single-page .mag-spread-container {
  justify-content: center;
}

.mag-scene.single-page .mag-half-left {
  display: none;
}

/* PAGE */
.mag-half-left {
  width: 50%;
  height: 100%;
  overflow: hidden;
  border: 2px solid #2a002a;
  border-right: none;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

.mag-half-right {
  width: 50%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform 0.7s ease-in-out;
  flex-shrink: 0;
}

.mag-half-right.flipping {
  transform: rotateY(-180deg);
}

.mag-page-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 2px solid #2a002a;
  border-left: none;
  background: #fff;
}

.mag-page-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  transform: rotateY(180deg);
  border: 2px solid #2a002a;
  border-right: none;
  background: #fff;
}

/* COUVERTURE */
.mag-cover {
  width: 100%;
  height: 100%;
  background: #ffd6e3;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.mag-cover-header {
  background: #FF3E6E;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #2a002a;
}

.mag-title-text {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #FFEA00;
  -webkit-text-stroke: 1px #2a002a;
  paint-order: stroke fill;
  letter-spacing: 2px;
}

.mag-issue {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.9);
}

.mag-cover-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd6e3, #DFC7FF);
  position: relative;
}

.mag-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #9a80a8;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}

.mag-cover-placeholder span {
  font-size: 3rem;
  opacity: 0.4;
}

.mag-cover-headlines {
  background: #fff;
  padding: 10px 16px;
  border-top: 3px solid #2a002a;
}

.mag-headline-big {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2a002a;
  line-height: 1.1;
}

.mag-headline-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: #FF3E6E;
  margin-top: 4px;
}

.mag-barcode {
  font-size: 0.4rem;
  letter-spacing: 1px;
  color: #2a002a;
  margin-top: 6px;
  font-family: monospace;
}

/* DOUBLE PAGE */
.mag-spread {
  display: flex;
  width: 100%;
  height: 100%;
}

.mag-spread-half {
  flex: 1;
  padding: 20px;
  position: relative;
  background: #fffef8;
  overflow: hidden;
}

.mag-spread-half.mag-spread-left {
  border-right: 1px solid #e0d0c0;
}

.mag-spine {
  width: 4px;
  background: linear-gradient(180deg, #e0c0c0, #c0a0a0, #e0c0c0);
  flex-shrink: 0;
  box-shadow: inset -1px 0 3px rgba(0,0,0,0.1), inset 1px 0 3px rgba(0,0,0,0.1);
}

/* PAGE SIMPLE (couverture verso) */
.mag-spread-right {
  padding: 20px;
  width: 100%;
  height: 100%;
  background: #fffef8;
  position: relative;
}

/* CONTENU */
.mag-page-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  color: #9a80a8;
  position: absolute;
  bottom: 10px;
  right: 14px;
}

.mag-spread-half.mag-spread-left .mag-page-num {
  right: auto;
  left: 14px;
}

.mag-rubrique {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: #FF3E6E;
  text-transform: uppercase;
  border-bottom: 1px solid #FF3E6E;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.mag-content-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70%;
}

.mag-text-placeholder {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: #c8a8c8;
  text-align: center;
  font-style: italic;
}

/* NAVIGATION */
.mag-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.mag-nav-btn {
  background: linear-gradient(180deg, #f0e8f8, #d8c8e8);
  border: 2px solid #9a80a8;
  border-radius: 2px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'VT323', monospace;
  color: #3a1a4a;
  box-shadow: 2px 2px 0 #9a80a8;
  transition: all 0.1s ease;
}

.mag-nav-btn:hover {
  background: linear-gradient(180deg, #fff, #e8d8f8);
  transform: translateY(-1px);
}

.mag-nav-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #9a80a8;
}

.mag-nav-pages {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: #ffd6e3;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  min-width: 120px;
  text-align: center;
}
