/* Polices auto-hébergées (voir /fonts/fonts.css) — aucune requête externe */
@import url('/fonts/fonts.css');

:root {
  --pink-light:  #FFD6E7;
  --pink-medium: #FF85B3;
  --pink-hot:    #FF1493;
  --gold:        #FFD700;
  --white-soft:  #FFF9FC;
  --text-dark:   #5C2A4A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
  background: var(--white-soft);
  color: var(--text-dark);
  overflow-x: clip;
}

/* ── Curseur custom ─────────────────────────────────────────────────────── */
/* Le vrai curseur n'est masqué que quand cursor.js tourne (html.cursor-perso) :
   sans JavaScript — ou avec prefers-reduced-motion — on garde le curseur normal. */
html.cursor-perso,
html.cursor-perso body,
html.cursor-perso .btn,
html.cursor-perso .calendar-nav,
html.cursor-perso .calendar-day.has-entry,
html.cursor-perso a, html.cursor-perso button {
  cursor: none;
}

#custom-cursor {
  display: none;
}

html.cursor-perso #custom-cursor {
  display: block;
}

#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease;
  user-select: none;
}

/* ── Canvas paillettes ──────────────────────────────────────────────────── */
#glitter-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout principal ───────────────────────────────────────────────────── */
.page-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--pink-medium), var(--pink-hot));
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(255,20,147,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.05em;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.6), transparent);
  transition: left 0.4s ease;
}

.btn:hover::after {
  left: 150%;
}

.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(255,20,147,0.55);
}

.btn:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--pink-light), var(--pink-medium));
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(255,133,179,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b9d, #ff1461);
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--pink-medium);
  color: var(--pink-hot);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--pink-light);
}

/* ── Cartes ─────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(255,20,147,0.12);
  border: 1px solid var(--pink-light);
}

/* ── Titres ─────────────────────────────────────────────────────────────── */
h1, h2 {
  font-family: 'Dancing Script', cursive;
  color: var(--pink-hot);
}

h3, h4 {
  font-family: 'Nunito', sans-serif;
  color: var(--text-dark);
}

/* ── Photos Elisa flottantes ────────────────────────────────────────────── */
.elisa-deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  filter: drop-shadow(0 4px 12px rgba(255,20,147,0.25));
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--pink-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: var(--pink-hot);
  text-decoration: none;
}

.navbar-links a {
  margin-left: 1.2rem;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  transition: color 0.2s;
}

.navbar-links a:hover {
  color: var(--pink-hot);
}

/* ── Page d'accueil ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

.hero-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--pink-hot);
  text-shadow: 0 0 30px rgba(255,20,147,0.4), 0 2px 0 rgba(255,215,0,0.5);
  line-height: 1.1;
  margin-bottom: 1rem;
  animation: titlePulse 3s ease-in-out infinite;
}

.hero-subtitle {
  font-family: 'Satisfy', cursive;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--text-dark);
  opacity: 0.8;
  margin-bottom: 2.5rem;
}

/* ── Calendrier ─────────────────────────────────────────────────────────── */
.calendar-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.calendar-month {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  color: var(--pink-hot);
}

.calendar-nav {
  background: none;
  border: 2px solid var(--pink-medium);
  color: var(--pink-hot);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.calendar-nav:hover {
  background: var(--pink-light);
  transform: scale(1.1);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-day-name {
  text-align: center;
  font-weight: 700;
  color: var(--pink-medium);
  font-size: 0.85rem;
  padding: 0.4rem 0;
  font-family: 'Nunito', sans-serif;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: 2px solid transparent;
  position: relative;
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.has-entry {
  background: linear-gradient(135deg, var(--pink-light), #ffb3d1);
  border-color: var(--pink-medium);
  box-shadow: 0 2px 10px rgba(255,133,179,0.3);
  cursor: pointer;
}

.calendar-day.has-entry:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,20,147,0.35);
  background: linear-gradient(135deg, var(--pink-medium), var(--pink-hot));
  color: white;
}

.calendar-day.today {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff8dc, #ffeaa0);
}

.calendar-day .entry-dot {
  font-size: 0.65rem;
  margin-top: 2px;
}

/* ── Vue d'une entrée ───────────────────────────────────────────────────── */
.entry-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.entry-date-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--pink-hot);
  text-align: center;
  margin-bottom: 0.5rem;
}

.entry-content {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(255,20,147,0.1);
  border: 1px solid var(--pink-light);
  line-height: 1.8;
  font-size: 1.05rem;
  white-space: pre-wrap;
  overflow-wrap: break-word; /* un lien ou un mot collé ne déborde pas de la carte */
  margin-bottom: 2rem;
}

/* ── Galerie photos ─────────────────────────────────────────────────────── */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.photo-item {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(255,20,147,0.2);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 1;
  border: 3px solid var(--pink-light);
}

.photo-item:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 25px rgba(255,20,147,0.35);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(92,42,74,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(255,20,147,0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  user-select: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.4);
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Moins de photos (voir elisa-deco.js) et plus discrètes derrière le texte */
  .elisa-deco { opacity: 0.5; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 3rem; }
  .calendar-day { font-size: 0.8rem; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0.8rem 1rem; }
  .navbar-brand { font-size: 1.4rem; }
}

/* ── Infos membre dans la navbar du journal ─────────────────────────────── */
#membre-info { display: inline-flex; align-items: center; gap: 0.6rem; }
.membre-pseudo { color: var(--pink-hot); font-weight: 700; font-size: 0.9rem; }
#membre-info a { font-size: 0.85rem; }

/* ── Clé discrète vers l'espace d'Elisa (accueil) ───────────────────────── */
.admin-key {
  position: fixed;
  bottom: 0.8rem;
  right: 1rem;
  font-size: 1.1rem;
  opacity: 0.35;
  text-decoration: none;
  z-index: 50;
  transition: opacity 0.2s, transform 0.2s;
}
.admin-key:hover { opacity: 1; transform: scale(1.2); }

/* ── Légendes des photos ─────────────────────────────────────────────────── */
.photo-item { position: relative; }

.photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.2rem 0.6rem 0.45rem;
  background: linear-gradient(transparent, rgba(92,42,74,0.75));
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.3;
  pointer-events: none;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 90vw;
}

.lightbox-figure img { max-width: 100%; }

.lightbox-caption {
  color: #fff;
  font-family: 'Satisfy', cursive;
  font-size: 1.15rem;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  max-width: 80vw;
}

/* ── Sections d'une journée à plusieurs entrées ──────────────────────────── */
.entry-section { margin-bottom: 2.2rem; }

.entry-section .entry-content { margin-bottom: 1.2rem; }

.entry-titre {
  font-family: 'Satisfy', cursive;
  color: var(--pink-hot);
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}

.entry-card-titre {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink-medium);
}

/* ── 💖 Réactions et 💬 commentaires ─────────────────────────────────────── */
.entry-pied {
  margin-top: 1.2rem;
  padding-top: 0.9rem;
  border-top: 2px dashed var(--pink-light);
}

.reaction-ligne {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.reaction-btn {
  border: 2px solid var(--pink-light);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.reaction-btn:hover { transform: scale(1.08); border-color: var(--pink-medium); }

.reaction-btn.active {
  background: var(--pink-light);
  border-color: var(--pink-hot);
}

.reaction-pseudos { color: var(--pink-medium); font-size: 0.85rem; }

.commentaires { margin-top: 1rem; }

.commentaire {
  background: #fff;
  border: 1px solid var(--pink-light);
  border-radius: 14px;
  padding: 0.7rem 0.95rem;
  margin-bottom: 0.6rem;
}

.commentaire-tete {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.commentaire-pseudo { color: var(--pink-hot); font-weight: 800; font-size: 0.9rem; }
.commentaire-date   { color: var(--pink-medium); font-size: 0.75rem; }

.commentaire-suppr {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--pink-medium);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
}
.commentaire-suppr:hover { color: var(--pink-hot); }

.commentaire-texte { font-size: 0.95rem; line-height: 1.5; overflow-wrap: break-word; }

.commentaire-form { display: flex; gap: 0.6rem; align-items: flex-end; margin-top: 0.8rem; }

.commentaire-form textarea {
  flex: 1;
  border: 2px solid var(--pink-light);
  border-radius: 14px;
  padding: 0.55rem 0.8rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  resize: vertical;
  min-height: 2.6rem;
  background: #fff;
}

.commentaire-form textarea:focus { outline: none; border-color: var(--pink-medium); }

.commentaire-form .btn { padding: 0.55rem 1.1rem; font-size: 0.9rem; white-space: nowrap; }

@media (max-width: 600px) {
  .commentaire-form { flex-direction: column; align-items: stretch; }
}

.entry-card-compteurs {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pink-medium);
}

/* ── Jour vide cliquable (Elisa peut y écrire un souvenir) ──────────────── */
.calendar-day.ecrivable { cursor: pointer; position: relative; }

.calendar-day.ecrivable:hover {
  border-color: var(--pink-medium);
  background: var(--white-soft);
}

.calendar-day.ecrivable:hover::after {
  content: '＋';
  position: absolute;
  bottom: 2px;
  font-size: 0.75rem;
  color: var(--pink-hot);
  font-weight: 800;
}
