/* style.css - dark theme, responsive */

/* Variables */
:root{
  --bg:#0f1116;
  --card:#0b1220;
  --muted:#98a0b3;
  --accent:#9b6bff;
  --glass: rgba(255,255,255,0.03);
  --radius:12px;
  --max-width:1200px;
  --text:#e6eef8;
  --muted-2:#9aa4b2;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  background:linear-gradient(180deg,#0b0f14,#0f1116);
  color:var(--text);
}

a{color:inherit;text-decoration:none}


/*marge header*/
main.container {
  padding-top: 20px; /* ajuster selon la hauteur réelle du header */
}

/* Empêche la grille de dépasser */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px;
  width: 100%;
}


@media (min-width:720px){
  .container{ padding:20px; }
}

@media (min-width:1100px){
  .container{ padding:24px; } /* bordures équilibrées */
}

@media (min-width:1400px){
  .container{ padding:28px; }
}

/* Header */
.site-header {
  background: rgba(15, 17, 22, 0.95); /* semi-transparent pour effet overlay si nécessaire */
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  
  position: sticky;  /* rend le header sticky */
  top: 0;            /* positionné en haut */
  left: 0;
  width: 100%;
  z-index: 1000;     /* s'assure que le header reste au-dessus du contenu */
}


.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (min-width:1100px){
  .header-inner{ padding:0 24px; }
}

.logo{
  font-weight:800;
  font-size:20px;
  letter-spacing:0.6px
}
.logo-accent{color:var(--accent)}

.spacer{flex:1}

/* Recherche responsive */
.search input {
  width: 100%;         /* prend toute la largeur disponible de son conteneur */
  max-width: 100%;    /* limite la largeur sur grand écran */
  border: 1px solid rgba(255,255,255,0.02);
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--muted);
  box-sizing: border-box;
}

.search {
  flex: 1 1 auto; /* occupe tout l’espace disponible */
  min-width: 0;   /* important pour que width:100% fonctionne correctement dans flex */
}


/* HERO */
.hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 320px;
  overflow: hidden;
}

/* Image */
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dégradé noir → transparent */
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 30%,
    rgba(0, 0, 0, 0.2) 55%,
    rgba(0, 0, 0, 0) 75%
  );
}

/* Contenu */
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8%;
}

/* Texte à gauche */
.hero-text {
  max-width: 520px;
  color: #fff;
}

.hero-text h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin-bottom: 12px;
}

.hero-text p {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Bouton */
.hero-btn {
  display: inline-block;
  width: auto;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 600;
  background: #ffffff;
  color: #000;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}



/* ---- GRID FIX ---- */
.catalog {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}


@media (min-width:720px){
  .catalog{
    grid-template-columns:repeat(3,1fr);
    padding-inline:6px;
  }
}

@media (min-width:1100px){
  .catalog{
    grid-template-columns:repeat(4,1fr);
    padding-inline:10px;
  }
}

@media (min-width:1400px){
  .catalog{
    grid-template-columns:repeat(5,1fr);
    padding-inline:16px;
  }
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  padding: 10px;
  border-radius: var(--radius);
  border: 3px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 340px; /* force une hauteur minimale */
}


/* Contenu flexible */
.meta {
  flex: 1; /* prend tout l’espace restant sous l’image */
}

/* Actions (bouton favoris) */
.actions {
  margin-top: auto; /* reste collé en bas */
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Version PC */
@media (min-width: 1100px) {
  .catalog {
    grid-template-columns: repeat(4, 1fr);
  }

  .card {
    min-height: 380px; /* un peu plus haut pour PC */
  }
}




/* Images totalement responsives */
.cover-img {
  width: 100%;
  height: auto;
  aspect-ratio: 155 / 180;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.meta{padding:8px 6px}
.meta h3{font-size:15px;margin:0 0 6px 0}
.meta .muted{font-size:13px;color:var(--muted)}
.actions{margin-top:auto;display:flex;gap:8px;align-items:center}
.card-link{display:block}

/* Controls */
.fav{
  background:transparent;
  border:0;
  color:var(--muted);
  font-size:20px;
  cursor:pointer;
}
.fav.active{color:gold}

/* Reader layout */
.reader-container{
  max-width:1100px;
  margin:12px auto;
  padding:0 16px; /* alignement corrigé */
}

.reader-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-radius:8px;
  margin-bottom:8px;
}

.reader-inner{height:78vh;overflow:auto}

.page{display:flex;justify-content:center}
.page-img{max-width:900px;width:100%;height:auto;border-radius:8px}

/* Watermark */
.reader-watermark{
  position:fixed;
  pointer-events:none;
  user-select:none;
  z-index:9998;
  color:rgba(255,255,255,0.12);
  font-weight:700;
  transform:rotate(-18deg);
  font-size:36px;
  white-space:nowrap;
  text-shadow:0 0 10px rgba(0,0,0,0.6);
  display:none;
}

.site-footer {
  background: #0b0e14; /* légèrement plus clair que le corps */
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 16px 12px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: var(--max-width);
  margin: 0 auto;
}


/*footer styles*/

/* Logo dans le footer */
.footer-inner .logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--text);
}

/* Mentions légales */
.footer-inner .legal {
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
}

.footer-inner .legal a {
  color: var(--muted-2);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-inner .legal a:hover {
  color: var(--accent);
}

/* Desktop layout */
@media (min-width: 720px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .footer-inner .legal {
    text-align: right;
  }
}




/* Chapter list */

.chapter-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.chapter-list li {
  background: var(--card);
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.chapter-list li a {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.chapter-list li:hover {
  background: rgba(255,255,255,0.05);
}


/* Close chapter button */

/* Bouton de fermeture (en haut à droite) */
.close-chapter {
  position: absolute;
  top: auto;
  right: 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: 0.2s;
  z-index: 20; /* pour être au-dessus du header */
}

.close-chapter:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Version PC : légèrement décalée */
@media (min-width: 900px) {
  .close-chapter {
    top: 20px;
    right: 24px;
    font-size: 30px;
  }
}

/* Reader close button */
.reader-close {
  position: absolute;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 28px;
  color: #bbb;
  font-weight: 700;
  transition: 0.2s;
}

.reader-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
}

/* Version PC */
@media (min-width: 900px) {
  .reader-close {
    right: 40px;
    font-size: 30px;
  }
}


/*image pour chaque chapitre*/
.chapter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  transition: transform 0.2s;
}

.chapter-item:hover {
  transform: scale(1.02);
}

.chapter-thumb {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.chapter-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}


/* Next chapter button */
/* Bandeau flottant pour le chapitre suivant */
.next-chapter-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 17, 22, 0.95);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.next-chapter-banner.show {
  opacity: 1;
  pointer-events: auto;
}

.next-chapter-banner a {
  color: #9b6bff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}

.next-chapter-banner a:hover {
  text-decoration: underline;
}


/* Désactive sélection et interactions */
.reader-container, 
.reader-container img {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: auto;
}

/* Empêche le drag des images */
img {
  -webkit-user-drag: none;
}


/* Shop CTA Section */

/* SHOP CTA */
/* SHOP CTA */
.shop-cta {
  margin: 48px 16px;
  padding: clamp(24px, 5vw, 48px);
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.9),
    rgba(0,0,0,0.65)
  );
  border-radius: 24px;
}

/* Conteneur */
.shop-cta-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* IMAGE */
.shop-cta-image {
  background: #fff;
  padding: 6px;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.shop-cta-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

/* TEXTE */
.shop-cta-content {
  color: #fff;
  text-align: center;
}

.shop-cta-text {
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* BOUTON */
.shop-cta-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 14px 24px;
  background: #fff;
  color: #000;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}


/* Medium screens */
@media (min-width: 768px) {
  .shop-cta {
    margin: 64px auto;
  }

  .shop-cta-inner {
    flex-direction: row;
    align-items: center;
    gap: 48px;
  }

  .shop-cta-image {
    margin: 0;
    max-width: none;
    flex: 1;
  }

  .shop-cta-content {
    flex: 1.1;
    text-align: left;
  }

  .shop-cta-btn {
    margin: 0;
    width: fit-content;
  }
}

/* Large screens */

@media (min-width: 1200px) {
  .shop-cta-inner {
    gap: 64px;
  }

  .shop-cta-text {
    max-width: 520px;
  }
}
