/* ============================================================
   Une Page de Nous — style
   ============================================================ */

:root {
    --paper:      #faf4ec;
    --paper-deep: #f1e7da;
    --ink:        #2b211c;
    --ink-soft:   #6b5d52;
    --accent:     #a8513f;   /* bois de rose / terre cuite */
    --accent-2:   #c98a6b;
    --line:       #e3d5c5;
    --radius:     18px;
    --shadow:     0 24px 60px -28px rgba(70, 45, 30, .45);
    --display:    "Fraunces", Georgia, serif;
    --body:       "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body);
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(1200px 600px at 80% -10%, rgba(201,138,107,.18), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(168,81,63,.12), transparent 55%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* subtil grain */
body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.muted { color: var(--ink-soft); }

main { min-height: 60vh; }

/* ---------- Navigation ---------- */
.site-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px clamp(20px, 5vw, 64px);
    max-width: 1100px; margin: 0 auto;
}
.site-nav .brand {
    font-family: var(--display);
    font-size: 1.25rem; font-weight: 600; color: var(--ink);
    text-decoration: none;
}
.site-nav nav { display: flex; align-items: center; gap: 22px; font-size: .95rem; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block;
    padding: 13px 26px;
    border-radius: 999px;
    font-family: var(--body);
    font-weight: 600; font-size: .98rem;
    cursor: pointer; border: 0;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 28px -12px rgba(168,81,63,.7); }
.btn-primary:hover { transform: translateY(-2px); text-decoration: none; }
.btn-ghost {
    background: transparent; color: var(--ink);
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Sections génériques ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.narrow { max-width: 680px; margin: 0 auto; padding: 0 24px; }

/* ---------- Accueil ---------- */
.hero { text-align: center; padding: clamp(56px, 12vh, 130px) 24px 40px; max-width: 820px; margin: 0 auto; }
.hero .eyebrow {
    text-transform: uppercase; letter-spacing: .28em; font-size: .72rem;
    color: var(--accent); font-weight: 600; margin-bottom: 26px;
}
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0 0 24px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--ink-soft); margin: 0 auto 38px; max-width: 560px; }

.fade-up { opacity: 0; transform: translateY(18px); animation: fadeUp .9s cubic-bezier(.2,.7,.2,1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .2s; } .d3 { animation-delay: .35s; } .d4 { animation-delay: .5s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* grille des modèles sur l'accueil */
.template-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-width: 920px; margin: 60px auto 0;
}
.template-card {
    border: 1.5px solid var(--line); border-radius: var(--radius);
    padding: 26px 20px; text-align: left; background: rgba(255,255,255,.5);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.template-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.template-card .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-2); margin-bottom: 14px; }
.template-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.template-card p { margin: 0; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Cartes / formulaires ---------- */
.card {
    background: rgba(255,255,255,.66);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(26px, 5vw, 48px);
    box-shadow: var(--shadow);
}
.page-head { text-align: center; padding: 50px 0 10px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 8px; }

label { display: block; font-weight: 600; margin: 18px 0 7px; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=url], input[type=datetime-local], textarea, select {
    width: 100%; padding: 13px 15px;
    border: 1.5px solid var(--line); border-radius: 12px;
    font-family: var(--body); font-size: 1rem; color: var(--ink);
    background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }
.hint { font-size: .82rem; color: var(--ink-soft); margin-top: 5px; }

.form-row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; font-size: .95rem; }
.alert-error { background: #fbe9e4; color: #8a2f1c; border: 1px solid #f0c8bd; }
.alert-ok { background: #e8f1e6; color: #2f5a34; border: 1px solid #cbe0c6; }

/* radios de modèle dans le formulaire */
.template-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); }
.template-pick label {
    margin: 0; border: 1.5px solid var(--line); border-radius: 12px;
    padding: 14px; cursor: pointer; font-weight: 500; text-align: center;
    transition: border-color .15s, background .15s;
}
.template-pick input { position: absolute; opacity: 0; }
.template-pick input:checked + span { color: var(--accent); }
.template-pick label:has(input:checked) { border-color: var(--accent); background: rgba(168,81,63,.06); }

/* ---------- Liste des pages (dashboard) ---------- */
.page-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); margin-top: 28px; }
.page-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: rgba(255,255,255,.6); }
.page-item h3 { margin: 0 0 6px; }
.page-item .meta { font-size: .82rem; color: var(--ink-soft); }
.page-item .actions { margin-top: 14px; display: flex; gap: 14px; font-size: .9rem; }
.badge { display: inline-block; font-size: .72rem; padding: 3px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); }

/* ============================================================
   AFFICHAGE D'UNE PAGE PUBLIÉE
   ============================================================ */
.page-view { padding-bottom: 80px; }
.page-cover {
    text-align: center; padding: clamp(60px, 14vh, 150px) 24px 70px;
    position: relative;
}
.page-cover .names { text-transform: uppercase; letter-spacing: .3em; font-size: .8rem; color: var(--accent); margin-bottom: 22px; }
.page-cover h1 { font-size: clamp(2.4rem, 7vw, 5rem); margin: 0 0 18px; }
.page-cover .date { font-style: italic; font-family: var(--display); font-size: 1.2rem; color: var(--ink-soft); }
.page-cover .cover-img {
    max-width: 520px; width: 100%; border-radius: var(--radius);
    margin: 36px auto 0; display: block; box-shadow: var(--shadow);
}
.intro { font-size: 1.18rem; line-height: 1.85; color: var(--ink); }
.section-title { text-align: center; font-size: clamp(1.6rem,4vw,2.4rem); margin: 70px 0 34px; }
.section-title small { display: block; text-transform: uppercase; letter-spacing: .25em; font-size: .7rem; color: var(--accent); font-family: var(--body); margin-bottom: 10px; }

/* timeline */
.timeline { position: relative; max-width: 700px; margin: 0 auto; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 34px 14px; }
.tl-item::before { content: ""; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--paper); }
.tl-item .tl-date { font-size: .82rem; color: var(--accent); font-weight: 600; }
.tl-item h4 { font-family: var(--display); font-size: 1.25rem; margin: 4px 0 6px; }
.tl-item p { margin: 0; color: var(--ink-soft); }

/* galerie */
.gallery { columns: 3 240px; column-gap: 16px; max-width: 920px; margin: 0 auto; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; }
.gallery img { width: 100%; border-radius: 14px; display: block; box-shadow: var(--shadow); }
.gallery figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: 8px; font-style: italic; }

/* lettre */
.letter { max-width: 640px; margin: 0 auto; background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(30px,5vw,54px); box-shadow: var(--shadow); }
.letter h3 { font-style: italic; font-size: 1.6rem; margin: 0 0 20px; }
.letter p { font-size: 1.1rem; line-height: 1.9; white-space: pre-wrap; }

/* message final */
.final { text-align: center; max-width: 600px; margin: 70px auto 0; }
.final p { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem,4vw,2rem); line-height: 1.5; }

/* livre d'or */
.guestbook { max-width: 640px; margin: 0 auto; }
.gb-entry { border-left: 3px solid var(--accent-2); padding: 8px 0 8px 18px; margin-bottom: 18px; }
.gb-entry strong { font-family: var(--display); }
.gb-entry .when { font-size: .78rem; color: var(--ink-soft); }

/* mode « ouvrir plus tard » */
.locked { text-align: center; padding: 18vh 24px; }
.locked h1 { font-size: clamp(2rem,6vw,3.4rem); }
.locked .countdown { font-family: var(--display); font-size: 2.4rem; color: var(--accent); margin-top: 20px; }

/* QR */
.qr-box { text-align: center; }
#qr { display: inline-block; padding: 16px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }

/* ---------- pied de page ---------- */
.site-footer { text-align: center; padding: 70px 24px 50px; color: var(--ink-soft); }
.site-footer p:first-child { font-family: var(--display); font-style: italic; font-size: 1.1rem; color: var(--ink); }

/* ============================================================
   THÈMES PAR MODÈLE  (classe sur <body>)
   ============================================================ */
body.t-couple   { --accent: #b14a55; --accent-2: #d98a8f; }
body.t-amitie   { --accent: #c77d2e; --accent-2: #e0aa63; }
body.t-famille  { --accent: #4f7a52; --accent-2: #8bae84; }
body.t-parent   { --accent: #d98a3d; --accent-2: #f0bd80; }
body.t-anniv    { --accent: #b8417a; --accent-2: #e07db0; }
body.t-souvenir { --accent: #6d6a8a; --accent-2: #a3a0bd; }
body.t-demande  { --accent: #a8513f; --accent-2: #c98a6b; }
body.t-secrete  { --accent: #3c3a4d; --accent-2: #6d6a8a; --paper: #f3eee9; }
