/* Palette douce pour un site de naissance : pastel, arrondi, léger. */
:root {
    --bg: #fff7f5;
    --bg-card: #ffffff;
    --text: #4a3f45;
    --text-soft: #8a7b82;
    --accent: #f4a6b7;
    --accent-soft: #ffe3ea;
    --accent-strong: #e88ca0;
    --lilac: #d9c5f0;
    --sky: #bcdcf0;
    --butter: #fde8b6;
    --border-radius: 1.25rem;
    --shadow: 0 8px 24px rgba(230, 170, 190, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg) 0%, #fef0f4 60%, #fbeaf1 100%);
    color: var(--text);
    font-family: "Nunito", "Segoe UI", sans-serif;
    line-height: 1.6;
}

h1, h2, h3, .baby-name {
    font-family: "Quicksand", "Nunito", sans-serif;
}

.page {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card.hero {
    padding: 2.5rem 1.75rem;
    box-shadow: 0 12px 32px rgba(230, 170, 190, 0.35);
    background: linear-gradient(160deg, #ffffff 0%, #fff6f8 100%);
}

.photo-session-banner {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 100%);
    border: 1px solid var(--accent);
}

.photo-session-banner-title {
    font-family: "Quicksand", "Nunito", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-strong);
}

.photo-session-banner-cta {
    font-weight: 600;
    color: var(--text-soft);
}

h1, h2, h3 {
    color: var(--accent-strong);
    font-weight: 700;
}

a {
    color: var(--accent-strong);
}

.button {
    display: inline-block;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(232, 140, 160, 0.4);
}

.button.secondary {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.button.danger {
    background: #f6c6c6;
    color: #8a3b3b;
}

input[type="text"], input[type="password"], input[type="date"], textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid var(--accent-soft);
    font-family: inherit;
    font-size: 1rem;
    background: #fffafb;
}

textarea {
    min-height: 6rem;
    resize: vertical;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-soft);
}

.field {
    margin-bottom: 1rem;
}

.hero {
    position: relative;
    text-align: center;
    overflow: hidden;
}

/* Éléments flottants décoratifs — purement esthétiques, ignorés des
   lecteurs d'écran, désactivés si l'utilisateur préfère moins d'animation. */
.floaties {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.floaties span {
    position: absolute;
    font-size: 1.4rem;
    opacity: 0.55;
    animation: float-drift 7s ease-in-out infinite;
}

.floaties span:nth-child(1) { left: 8%;  top: 68%; font-size: 1.1rem; animation-delay: 0s;    animation-duration: 8s; }
.floaties span:nth-child(2) { left: 85%; top: 60%; font-size: 1.3rem; animation-delay: 1.2s;  animation-duration: 6.5s; }
.floaties span:nth-child(3) { left: 18%; top: 15%; font-size: 1.4rem; animation-delay: 2.4s;  animation-duration: 7.5s; }
.floaties span:nth-child(4) { left: 78%; top: 12%; font-size: 1.5rem; animation-delay: 0.6s;  animation-duration: 9s; }
.floaties span:nth-child(5) { left: 50%; top: 78%; font-size: 1.1rem; animation-delay: 3s;    animation-duration: 6s; }
.floaties span:nth-child(6) { left: 6%;  top: 38%; font-size: 0.9rem; animation-delay: 1.8s;  animation-duration: 8.5s; }

.floaties .invader {
    color: var(--accent-strong);
}

.floaties .invader svg {
    display: block;
    width: 1.3em;
    height: 1em;
}

@keyframes float-drift {
    0%, 100% { transform: translateY(0) rotate(-4deg); opacity: 0.4; }
    50%      { transform: translateY(-14px) rotate(6deg); opacity: 0.75; }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content > * {
    opacity: 0;
    animation: hero-enter 0.8s ease-out forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }
.hero-content > *:nth-child(5) { animation-delay: 0.65s; }
.hero-content > *:nth-child(6) { animation-delay: 0.8s; }

@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero .sparkle {
    display: inline-block;
    font-size: 1.4rem;
    animation: sparkle-pulse 2.6s ease-in-out infinite;
}

@keyframes sparkle-pulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.18); opacity: 1; }
}

.hero .baby-name {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0.35rem 0;
    background: linear-gradient(90deg, var(--accent-strong), #d98fb0 50%, var(--accent-strong));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .birth-date {
    color: var(--text-soft);
    font-size: 1.1rem;
}

.hero .age-counter {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.photo-main-card {
    padding: 0.6rem;
}

.photo-main {
    width: 100%;
    height: auto;
    max-height: 34rem;
    object-fit: contain;
    border-radius: calc(var(--border-radius) - 0.4rem);
    display: block;
    background: #000;
    margin: 0 auto;
}

/* Rangées en flexbox (pas de colonnes CSS) : chaque photo/vidéo garde sa
   propre orientation (portrait, paysage, carrée) au lieu d'être recadrée
   en carré, ET l'ordre visuel (gauche à droite, haut en bas) reste celui
   du DOM — donc celui de la requête SQL (date DESC). Un masonry en
   colonnes CSS remplit une colonne entière avant de passer à la
   suivante : l'ordre visuel ne correspond plus à l'ordre chronologique
   dès qu'il y a plus d'une colonne, même si le tri SQL est correct —
   bug réel signalé (« la galerie n'est pas triée ») alors que la
   requête l'était déjà. */
.photo-grid-manage {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.photo-manage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.photo-manage img,
.photo-manage video {
    height: 10rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0.9rem;
    box-shadow: var(--shadow);
    background: #000;
}

.photo-manage.is-featured img,
.photo-manage.is-featured video {
    outline: 3px solid var(--accent-strong);
    outline-offset: 2px;
}

.photo-manage-button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.photo-pick {
    cursor: pointer;
}

.photo-pick input[type="checkbox"] {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.4rem;
    height: 1.4rem;
    accent-color: var(--accent-strong);
    z-index: 1;
}

.photo-pick:has(input:checked) img,
.photo-pick:has(input:checked) video {
    outline: 3px solid var(--accent-strong);
    outline-offset: 2px;
}

.featured-badge {
    align-self: center;
    background: var(--accent-strong);
    color: white;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .floaties span,
    .hero-content > *,
    .hero .sparkle {
        animation: none;
        opacity: 1;
    }
}

.photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.photo-grid img,
.photo-grid video {
    height: 10rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0.9rem;
    box-shadow: var(--shadow);
    background: #000;
}

.entry-meta {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.entry-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* Affiché en permanence (sticky) -> volontairement discret et compact,
   sur une seule ligne (pas de flex-wrap), quitte à scroller
   horizontalement sur un très petit écran plutôt que de passer sur
   deux lignes et prendre trop de place. */
nav.top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-card);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(230, 170, 190, 0.2);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

nav.top a {
    white-space: nowrap;
}

.flash {
    background: var(--accent-soft);
    border-radius: 0.8rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--accent-strong);
}

/* Mobile : texte plus grand plutôt que la même taille écrasée sur un
   petit écran — comme tout est en rem, augmenter la racine suffit à
   faire grossir proportionnellement tout le site d'un coup. */
@media (max-width: 600px) {
    html {
        font-size: 118.75%; /* ~19px au lieu de 16px */
    }

    .page {
        padding: 1.5rem 1rem 3rem;
    }

    nav.top {
        gap: 0.7rem;
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .entry-meta,
    .photo-manage-button,
    .featured-badge {
        font-size: 1rem;
    }

    .hero .baby-name {
        font-size: 2.4rem;
    }
}

.site-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent-soft);
    font-size: 0.9rem;
}

.site-footer a {
    color: var(--text-soft);
}
